diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-25 09:40:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:04:48 -0700 |
commit | ea33f8c6c66bbf16c58965b9f5204d111969bf8c (patch) | |
tree | fe2b3bd7bb06af80568a1e7df76cbb85615baead /flow.c | |
parent | Fix up various pseudo usage list issues: (diff) | |
download | sparse-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |