aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-28 12:37:23 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:10 -0700
commitf4b2e9f3721f06f5eb5896bf44c4e994d9a67203 (patch)
tree5241536a830a1523c92786e1b122b8bcad21bb4f
parent9c9b53ee5521b9df5cb54f23a1642145de0f47e2 (diff)
downloadsparse-dev-f4b2e9f3721f06f5eb5896bf44c4e994d9a67203.tar.gz
Check switch and computed goto target lists too when verifying.
And don't remove a parent from a list when "rewrite_parent_brach()" should already have updated the flow properly.
-rw-r--r--flow.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index 583da5ad..bc76c828 100644
--- a/flow.c
+++ b/flow.c
@@ -706,7 +706,6 @@ static struct basic_block * rewrite_branch_bb(struct basic_block *bb, struct ins
while ((parent = first_basic_block(bb->parents)) != NULL) {
if (!rewrite_parent_branch(parent, bb, target))
return NULL;
- remove_bb_from_list(&bb->parents, parent, 0);
}
return target;
}
@@ -779,10 +778,17 @@ static void vrfy_children(struct basic_block *bb)
return;
}
switch (br->opcode) {
+ struct multijmp *jmp;
case OP_BR:
vrfy_bb_in_list(br->bb_true, bb->children);
vrfy_bb_in_list(br->bb_false, bb->children);
break;
+ case OP_SWITCH:
+ case OP_COMPUTEDGOTO:
+ FOR_EACH_PTR(br->multijmp_list, jmp) {
+ vrfy_bb_in_list(jmp->target, bb->children);
+ } END_FOR_EACH_PTR(jmp);
+ break;
default:
break;
}