simple C compiler
git clone
Log | Files | Refs | README | LICENSE

commit de85950a6348a31dece85612c0ec77e1e59200dd
parent 22184f3e29a6fb3069769e7244edfa4e610c9975
Author: Roberto E. Vargas Caballero <>
Date:   Thu, 18 Aug 2016 12:57:49 +0200

[cc2-qbe] Fix OAND case in bool()

When bool() calls itself recursively in OAND we have to maintain
the label for the false case, but the code was changing it to the
label for the true case, generating an inversion in the left part
of the OAND expression.

Mcc2/arch/qbe/cgen.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c @@ -321,7 +321,7 @@ bool(Node *np, Symbol *true, Symbol *false) break; case OAND: label = newlabel(); - bool(l, label, true); + bool(l, label, false); setlabel(label); bool(r, true, false); break;