From 2a2aede4c5ec88b54c9e4b3a9e3e335fab2fe87a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 2 Nov 2010 13:39:16 -0600 Subject: [PATCH] avoid JIT internal error for misuse of unsafe flonum args --- src/racket/src/jit.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/racket/src/jit.c b/src/racket/src/jit.c index bdc3e3f7fb..5e82c71ce6 100644 --- a/src/racket/src/jit.c +++ b/src/racket/src/jit.c @@ -11116,12 +11116,25 @@ static int generate(Scheme_Object *obj, mz_jit_state *jitter, int is_tail, int w else finish_branch_with_true(jitter, for_branch); return 1; - } else if (jitter->unbox && SCHEME_FLOATP(obj)) { - double d = SCHEME_FLOAT_VAL(obj); + } else if (jitter->unbox) { + double d; int fpr0; + + if (SCHEME_FLOATP(obj)) + d = SCHEME_FLOAT_VAL(obj); + else { + scheme_log(NULL, + SCHEME_LOG_WARNING, + 0, + "warning: JIT detects flonum operation applied to non-flonum constant: %V", + obj); + d = 0.0; + } + fpr0 = JIT_FPR(jitter->unbox_depth); mz_movi_d_fppush(fpr0, d, target); jitter->unbox_depth++; + return 1; } else if (!result_ignored) { int retptr;