From 38da2aa2e7699528899f17bb853bcea966a0abf5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 5 Dec 2014 10:16:40 -0700 Subject: [PATCH] fix a problem mixing JIT and non-JIT code Crashes the "optimize.rktl" test suite when the JIT supported but disabled, because that test suite re-enables the JIT. --- racket/src/racket/src/eval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/racket/src/racket/src/eval.c b/racket/src/racket/src/eval.c index f3d5786c66..3fa15870fa 100644 --- a/racket/src/racket/src/eval.c +++ b/racket/src/racket/src/eval.c @@ -2448,7 +2448,11 @@ scheme_make_closure(Scheme_Thread *p, Scheme_Object *code, int close) data = (Scheme_Closure_Data *)code; #ifdef MZ_USE_JIT - if (data->u.native_code) { + if (data->u.native_code + /* If the union points to a another Scheme_Closure_Data*, then it's not actually + a pointer to native code. We must have a closure referenced frmo non-JITted code + where the closure is also referenced by JITted code. */ + && !SAME_TYPE(SCHEME_TYPE(data->u.native_code), scheme_unclosed_procedure_type)) { Scheme_Object *nc; nc = scheme_make_native_closure(data->u.native_code);