Skip to content

Commit

Permalink
Merge branch 'jpellegrini-compiler-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
egallesio committed Aug 31, 2024
2 parents c62f890 + daad435 commit b215371
Show file tree
Hide file tree
Showing 3 changed files with 4,634 additions and 4,586 deletions.
9 changes: 7 additions & 2 deletions lib/compiler.stk
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,9 @@ doc>
(b (cadr actuals)))
(cond
((and (number? a) (number? b))
(compile-constant (/ a b) env tail?))
(if (eq? b 0)
(compiler-error '/ epair "division by zero")
(compile-constant (/ a b) env tail?)))
((small-integer-constant? b)
(oper2 'IN-SINT-DIV2 a b))
(else
Expand All @@ -1270,12 +1272,15 @@ doc>
((2) (let ((a (car actuals))
(b (cadr actuals)))
(cond
((and (eq? fct 'fxquotient) (eq? b 0))
(compiler-error 'fxquotient epair "division by 0"))
((and (fixnum? a) (fixnum? b))
(compile-constant (case fct
((fx+) (fx+ a b))
((fx-) (fx- a b))
((fx*) (fx* a b))
(else (fxquotient a b)))
(else
(fxquotient a b)))
env
tail?))
((and (small-integer-constant? a)
Expand Down
Loading

0 comments on commit b215371

Please sign in to comment.