Fix integer comparisons

This commit is contained in:
cannoli-fruit 2026-07-31 01:27:10 -04:00
commit 913aa8523e

View file

@ -405,14 +405,14 @@ codegenIR:
break;
}
if (SBeq(&tokenAccumulator, "if")) {
lz_da_append(labelStack, counter);
commentStack(&labelStack);
break;
}
if (SBeq(&tokenAccumulator, "then")) {
IRComplete(&irStatements, &irVStack);
vstackUnderflows = 0;
lz_da_append(labelStack, counter);
commentStack(&labelStack);
vstackUnderflows = 0;
int lbl = lz_da_pop(labelStack);
lz_da_append(labelStack, lbl);
printf(" popstack 123\n");
@ -452,7 +452,7 @@ codegenIR:
} else if (irVStack.cnt == 0) {
x1 = (IRValue) {
.typ = IRVAL_STACK,
.val = 1
.val = ++vstackUnderflows
};
}
IRValue dstReg = (IRValue) {
@ -716,7 +716,7 @@ codegenIR:
};
IRStatement s = (IRStatement) {
.dst = dstReg,
.op = IR_ILT,
.op = IR_IGT,
.arg1 = x1,
.arg2 = x2
};
@ -732,7 +732,7 @@ codegenIR:
};
IRStatement s = (IRStatement) {
.dst = dstReg,
.op = IR_IGT,
.op = IR_ILT,
.arg1 = x1,
.arg2 = x2
};