diff options
author | johnvg | 2001-03-28 13:04:56 +0000 |
---|---|---|
committer | johnvg | 2001-03-28 13:04:56 +0000 |
commit | b8824cc3bbbe98304f3eee9f4093ec02fb489de6 (patch) | |
tree | 706c9ad94da363b9342dec1bebe97a81025dae31 | |
parent | added TVI_Normalized (diff) |
fixed bug in contains_fail
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@349 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r-- | backendC/CleanCompilerSources/codegen1.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/backendC/CleanCompilerSources/codegen1.c b/backendC/CleanCompilerSources/codegen1.c index 6a60cfa..64361f4 100644 --- a/backendC/CleanCompilerSources/codegen1.c +++ b/backendC/CleanCompilerSources/codegen1.c @@ -3672,17 +3672,20 @@ static int generate_code_for_push_node (NodeP node,int asp,int bsp,struct esc *e int contains_fail (NodeP node_p) { while (node_p->node_kind==IfNode){ - NodeP else_node_p; + NodeP then_node_p,else_node_p; + then_node_p=node_p->node_arguments->arg_next->arg_node; else_node_p=node_p->node_arguments->arg_next->arg_next->arg_node; - while (else_node_p->node_kind==IfNode) - else_node_p=else_node_p->node_arguments->arg_next->arg_next->arg_node; - + if (else_node_p->node_kind==NormalNode && else_node_p->node_symbol->symb_kind==fail_symb) return 1; - node_p=node_p->node_arguments->arg_next->arg_node; + if (then_node_p->node_kind==IfNode && contains_fail (then_node_p)) + return 1; + + node_p=else_node_p; } + return 0; } #endif |