feat: implement all runtime errors #32

Merged
jt2622 merged 16 commits from runtime-errors into master 2025-02-28 00:23:13 +00:00
2 changed files with 135 additions and 34 deletions
Showing only changes of commit 617f6759d3 - Show all commits

View File

@@ -336,6 +336,7 @@ object asmGenerator {
chain += Jump(LabelArg(OverflowError.errLabel), Cond.Overflow) chain += Jump(LabelArg(OverflowError.errLabel), Cond.Overflow)
case BinaryOperator.Sub => case BinaryOperator.Sub =>
chain += Subtract(destX, stack.head) chain += Subtract(destX, stack.head)
chain += Jump(LabelArg(OverflowError.errLabel), Cond.Overflow)
chain += stack.drop() chain += stack.drop()
chain += stack.push(destX.size, RAX) chain += stack.push(destX.size, RAX)
case BinaryOperator.Mul => case BinaryOperator.Mul =>