diff --git a/collects/tests/racket/optimize.rktl b/collects/tests/racket/optimize.rktl index a4a2372f34..3f92c26615 100644 --- a/collects/tests/racket/optimize.rktl +++ b/collects/tests/racket/optimize.rktl @@ -1924,6 +1924,11 @@ (lambda () (set! a 'v))))))) +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Check compilation of an n-ary `/' that isn't +;; constant folded due to a divide-by-zero: + +(err/rt-test (call/cc (lambda (k) (/ 1 2 0)))) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/racket/src/jitarith.c b/src/racket/src/jitarith.c index 12bda60dea..e99b7f4121 100644 --- a/src/racket/src/jitarith.c +++ b/src/racket/src/jitarith.c @@ -1903,9 +1903,10 @@ int scheme_generate_nary_arith(mz_jit_state *jitter, Scheme_App_Rec *app, __START_SHORT_JUMPS__(c < 100); - if (trigger_arg > c) { - /* we don't expect this to happen, since constant-folding would - have collapsed it */ + if (trigger_arg >= c) { + /* we don't expect this to happen, since constant-folding normally + would have collapsed it --- but a division by zero, for example, + might block constant folding */ trigger_arg = 0; }