aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-29 12:42:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:16 -0700
commit53fab69297147a31f548189ad1c4f699bd925966 (patch)
tree318fe12348528d88310f05c0ba8a2c527b482fd5 /simplify.c
parentRename "register.c" into "liveness.c". That's what it does. (diff)
downloadsparse-53fab69297147a31f548189ad1c4f699bd925966.tar.gz
sparse-53fab69297147a31f548189ad1c4f699bd925966.tar.bz2
sparse-53fab69297147a31f548189ad1c4f699bd925966.zip
Don't go off into infinite loops when some undefined program
updates a variable where the only def is the update itself. Testcase from Alexey Dobriyan
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index 53c5188..8a8d450 100644
--- a/simplify.c
+++ b/simplify.c
@@ -441,6 +441,13 @@ static int simplify_memop(struct instruction *insn)
return 0;
offset:
+ /* Invalid code */
+ if (new == addr) {
+ if (new == VOID)
+ return 0;
+ new = VOID;
+ warning(insn->bb->pos, "crazy programmer");
+ }
insn->offset += off->value;
use_pseudo(new, &insn->src);
remove_usage(addr, &insn->src);