[hackers] [scc] [cc2-qbe] Fix OAND case in bool() || Roberto E. Vargas Caballero
commit de85950a6348a31dece85612c0ec77e1e59200dd
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Aug 18 12:57:49 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Aug 18 12:57:49 2016 +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.
diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index bd0e5dd..43a6020 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
_AT_@ -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;
Received on Thu Aug 18 2016 - 13:02:09 CEST
This archive was generated by hypermail 2.3.0
: Thu Aug 18 2016 - 13:12:16 CEST