aboutsummaryrefslogtreecommitdiffstats
path: root/prog/prog.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/prog.go')
-rw-r--r--prog/prog.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/prog/prog.go b/prog/prog.go
index f93293b64..da6f158bc 100644
--- a/prog/prog.go
+++ b/prog/prog.go
@@ -354,6 +354,9 @@ func (p *Prog) insertBefore(c *Call, calls []*Call) {
// replaceArg replaces arg with arg1 in a program.
func replaceArg(arg, arg1 Arg) {
+ if arg == arg1 {
+ panic("replacing an argument with itself")
+ }
switch a := arg.(type) {
case *ConstArg:
*a = *arg1.(*ConstArg)