Fix dumbing bug
This commit is contained in:
parent
1177462bda
commit
2f67a6f109
@ -109,6 +109,10 @@ static void mark_d(ScopeItem *si) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* RULE ONE OF DUMBING: NEVER xopify NOR varify MORE THAN ONCE IN A SINGLE CALL TO VISITOR!!!
|
||||
* IF YOU DO THIS, stmtPrev WILL FUCK UP AND STATEMENTS WILL BE LOST
|
||||
*/
|
||||
struct DumbenState {
|
||||
AST *targetTLC;
|
||||
int effective;
|
||||
@ -129,14 +133,10 @@ static void dumben_visitor(AST **nptr, AST *stmt, AST *stmtPrev, AST *chu, AST *
|
||||
if(is_xop(e->exprBinOp.operands[0]) == XOP_NOT_XOP) {
|
||||
e->exprBinOp.operands[0] = xopify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[0]);
|
||||
this->effective = 1;
|
||||
}
|
||||
|
||||
if(is_xop(e->exprBinOp.operands[1]) == XOP_NOT_XOP) {
|
||||
} else if(is_xop(e->exprBinOp.operands[1]) == XOP_NOT_XOP) {
|
||||
e->exprBinOp.operands[1] = xopify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[1]);
|
||||
this->effective = 1;
|
||||
}
|
||||
|
||||
if(is_xop(e->exprBinOp.operands[0]) == XOP_MEM && is_xop(e->exprBinOp.operands[1]) == XOP_MEM) {
|
||||
} else if(is_xop(e->exprBinOp.operands[0]) == XOP_MEM && is_xop(e->exprBinOp.operands[1]) == XOP_MEM) {
|
||||
// Can't have two mems; put one in var
|
||||
|
||||
e->exprBinOp.operands[1] = varify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user