aboutsummaryrefslogtreecommitdiff
path: root/flow.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-25 09:40:23 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:04:48 -0700
commitea33f8c6c66bbf16c58965b9f5204d111969bf8c (patch)
treefe2b3bd7bb06af80568a1e7df76cbb85615baead /flow.c
parentFix up various pseudo usage list issues: (diff)
downloadsparse-ea33f8c6c66bbf16c58965b9f5204d111969bf8c.tar.gz
sparse-ea33f8c6c66bbf16c58965b9f5204d111969bf8c.tar.bz2
sparse-ea33f8c6c66bbf16c58965b9f5204d111969bf8c.zip
Validity-check the pseudo 'use' list.
This is largely how I found all the pseudo rewriting bugs, so let's just make it the norm. I'm not a huge fan of asserts, but as long as it's _really_ a "this is a fundamental problem" thing, rather than a "I'm not handling this case correctly", they're ok.
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/flow.c b/flow.c
index f8e2a93..4643251 100644
--- a/flow.c
+++ b/flow.c
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
+#include <assert.h>
#include "parse.h"
#include "expression.h"
@@ -145,6 +146,7 @@ void convert_instruction_target(struct instruction *insn, pseudo_t src)
*/
target = insn->target;
FOR_EACH_PTR(target->users, usep) {
+ assert(*usep == target);
*usep = src;
} END_FOR_EACH_PTR(usep);
concat_user_list(target->users, &src->users);