From 420d3e77171ff85a41ac30a06572f20b1bf44f38 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 12 Mar 2012 08:23:17 -0600 Subject: [PATCH] fix JIT bug exposed by OpenBSD 5.0 This is the second attempt to fix a problem with using a JIT-generated address in JIT-generated code. Closes PR 12627 --- src/racket/src/jitcommon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/racket/src/jitcommon.c b/src/racket/src/jitcommon.c index d18254911b..f3793d1eb4 100644 --- a/src/racket/src/jitcommon.c +++ b/src/racket/src/jitcommon.c @@ -2606,7 +2606,8 @@ static int common10(mz_jit_state *jitter, void *_data) jit_ldxi_i(JIT_R2, JIT_V1, &((Scheme_Native_Closure_Data *)0x0)->closure_size); (void)jit_blti_i(refslow, JIT_R2, 0); /* case lambda */ jit_ldxi_p(JIT_R2, JIT_V1, &((Scheme_Native_Closure_Data *)0x0)->start_code); - jit_movi_p(JIT_V1, scheme_on_demand_jit_code); /* movi_p doesn't depend on actual address, which might change size */ + /* patchable_movi_p doesn't depend on actual address, which might change size: */ + (void)jit_patchable_movi_p(JIT_V1, scheme_on_demand_jit_code); ref_nc = jit_beqr_p(jit_forward(), JIT_R2, JIT_V1); /* not yet JITted? */ jit_rshi_l(JIT_V1, JIT_R1, 1); jit_addi_l(JIT_V1, JIT_V1, 1);