🐛 fix codegen skip or/and expr bug

This commit is contained in:
ValKmjolnir 2023-05-08 19:23:50 +08:00
parent 92abad3384
commit 666fb8b25f
1 changed files with 2 additions and 5 deletions

View File

@ -691,13 +691,10 @@ void codegen::expr_gen(const ast& node) {
case ast_cmpeq:case ast_neq: case ast_cmpeq:case ast_neq:
case ast_leq:case ast_less: case ast_leq:case ast_less:
case ast_geq:case ast_grt: case ast_geq:case ast_grt:
case ast_or:case ast_and:
case ast_trino: case ast_trino:
calc_gen(node); calc_gen(node);
if (code.back().op==op_meq) { gen(op_pop, 0, node.line());
code.back().num=1;
} else {
gen(op_pop, 0, node.line());
}
break; break;
case ast_equal: case ast_equal:
if (node[0].type()==ast_id) { if (node[0].type()==ast_id) {