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 {
|
struct DumbenState {
|
||||||
AST *targetTLC;
|
AST *targetTLC;
|
||||||
int effective;
|
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) {
|
if(is_xop(e->exprBinOp.operands[0]) == XOP_NOT_XOP) {
|
||||||
e->exprBinOp.operands[0] = xopify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[0]);
|
e->exprBinOp.operands[0] = xopify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[0]);
|
||||||
this->effective = 1;
|
this->effective = 1;
|
||||||
}
|
} else if(is_xop(e->exprBinOp.operands[1]) == XOP_NOT_XOP) {
|
||||||
|
|
||||||
if(is_xop(e->exprBinOp.operands[1]) == XOP_NOT_XOP) {
|
|
||||||
e->exprBinOp.operands[1] = xopify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[1]);
|
e->exprBinOp.operands[1] = xopify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[1]);
|
||||||
this->effective = 1;
|
this->effective = 1;
|
||||||
}
|
} else if(is_xop(e->exprBinOp.operands[0]) == XOP_MEM && is_xop(e->exprBinOp.operands[1]) == XOP_MEM) {
|
||||||
|
|
||||||
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
|
// Can't have two mems; put one in var
|
||||||
|
|
||||||
e->exprBinOp.operands[1] = varify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[1]);
|
e->exprBinOp.operands[1] = varify(tlc, chu, stmtPrev, s, e->exprBinOp.operands[1]);
|
||||||
@ -164,7 +164,7 @@ static void dumben_visitor(AST **nptr, AST *stmt, AST *stmtPrev, AST *chu, AST *
|
|||||||
ast_denoop(tlc, &s->stmtJump.condition);
|
ast_denoop(tlc, &s->stmtJump.condition);
|
||||||
|
|
||||||
this->effective = 1;
|
this->effective = 1;
|
||||||
|
|
||||||
} else if(e->nodeKind == AST_EXPR_BINARY_OP && e->exprBinOp.operator == BINOP_LOGICAL_OR) {
|
} else if(e->nodeKind == AST_EXPR_BINARY_OP && e->exprBinOp.operator == BINOP_LOGICAL_OR) {
|
||||||
|
|
||||||
AST *cond0 = e->exprBinOp.operands[0];
|
AST *cond0 = e->exprBinOp.operands[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user