commit c72e4d06d0b6510f3dbb0ea05a15e83b0696262b
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Tue Sep 27 17:06:46 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Tue Sep 27 17:06:46 2016 +0200
[cc2-qbe] Fix default case in bool()
We were generating code for the left child of the parameter,
but we had to generate the code for the node itself.
diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 3df8a8f..1c7b8fb 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -362,7 +362,7 @@ bool(Node *np, Symbol *true, Symbol *false)
default:
label2node(&ifyes, true);
label2node(&ifno, false);
- code(ASBRANCH, rhs(l, &ret), &ifyes, &ifno);
+ code(ASBRANCH, rhs(np, &ret), &ifyes, &ifno);
break;
}
}