IR jmp and scopes

This commit is contained in:
r4 committed 2021-12-21 13:59:08 +01:00
1 parent 6080901842
commit 005309d1eb
5 files changed
+33 -7

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ Value eval_arith(IRInstr instr, const Value *lhs, const Value *rhs) {
case IRSub: res = lhs->Int - rhs->Int; break;
case IRMul: res = lhs->Int * rhs->Int; break;
case IRDiv: res = lhs->Int / rhs->Int; break;
default: break;
default: ASSERT_UNREACHED();
}
return (Value){
.type.kind = TypeInt,
@@ -28,7 +28,7 @@ Value eval_arith(IRInstr instr, const Value *lhs, const Value *rhs) {
case IRSub: res = lhs->Float - rhs->Float; break;
case IRMul: res = lhs->Float * rhs->Float; break;
case IRDiv: res = lhs->Float / rhs->Float; break;
default: break;
default: ASSERT_UNREACHED();
}
return (Value){
.type.kind = TypeFloat,