summary refs log tree commit diff
path: root/copy.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2019-05-14 18:43:39 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2019-05-14 18:43:39 +0200
commit1b1a7f618ce9fc6b455e3c30213a8ec8feaab1dc (patch)
tree30bd9c988d46ea76067789dfb941ab14c7bd1a68 /copy.c
parent61309852742548b496d222cf4e3f2c5e1569e6dd (diff)
downloadroux-1b1a7f618ce9fc6b455e3c30213a8ec8feaab1dc.tar.gz
fix a bad bug in copy detection
The code used to see add 0, 10 as
a copy of 0.
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/copy.c b/copy.c
index 8354929..3aa3b98 100644
--- a/copy.c
+++ b/copy.c
@@ -27,11 +27,11 @@ iscopy(Ins *i, Ref r, Fn *fn)
 	case Ocopy:
 		return 1;
 	case Omul:
-		return iscon(i->arg[0], 1, fn) || iscon(i->arg[1], 1, fn);
+		return iscon(i->arg[1], 1, fn);
 	case Odiv:
 		return iscon(i->arg[1], 1, fn);
 	case Oadd:
-		return iscon(i->arg[0], 0, fn) || iscon(i->arg[1], 0, fn);
+		return iscon(i->arg[1], 0, fn);
 	default:
 		break;
 	}