From ba182b139aa53fa70dd44fea9f74f777f3c683f7 Mon Sep 17 00:00:00 2001 From: pcpa Date: Thu, 29 Aug 2013 12:59:40 -0300 Subject: [PATCH] Avoid possible problem if built with gcc 4.8 or newer. The problem happens due to undefined behavior in post increment when accessing data through an union and the data being modified in the expression. --- lib/jit_ia64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/jit_ia64.c b/lib/jit_ia64.c index 418d4e47d..b123bdff6 100644 --- a/lib/jit_ia64.c +++ b/lib/jit_ia64.c @@ -763,7 +763,8 @@ _emit_code(jit_state_t *_jit) undo.prolog_offset = 0; /* code may start with a jump so add an initial function descriptor */ - il(_jit->pc.w + 16); /* addr */ + word = _jit->pc.w + 16; + il(word); /* addr */ il(0); /* gp */ #define case_rr(name, type) \ case jit_code_##name##r##type: \ @@ -1264,7 +1265,8 @@ _emit_code(jit_state_t *_jit) } _jitc->prolog.ptr[_jitc->prolog.offset++] = _jit->pc.w; /* function descriptor */ - il(_jit->pc.w + 16); /* addr */ + word = _jit->pc.w + 16; + il(word); /* addr */ il(0); /* gp */ } prolog(node);