summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2013-05-23 19:43:41 +0200
committerMike Pall <mike>2013-05-23 19:55:09 +0200
commit890754ee27d564335865a0ba731e69c6a6191655 (patch)
tree5079e070deef8e28c9465ad49bea543f88a6e11a
parent1593e7750b29d11b71f20dbde85845b7b0689d1d (diff)
downloadluajit2-890754ee27d564335865a0ba731e69c6a6191655.tar.gz
FFI: Insert no-op type conversion for pointer to integer cast.
-rw-r--r--src/lj_crecord.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index 2d630c85..e3973fc1 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -453,6 +453,10 @@ static TRef crec_ct_ct(jit_State *J, CType *d, CType *s, TRef dp, TRef sp,
sinfo = CTINFO(CT_NUM, CTF_UNSIGNED);
ssize = CTSIZE_PTR;
st = IRT_UINTP;
+ if (((dsize ^ ssize) & 8) == 0) { /* Must insert no-op type conversion. */
+ sp = emitconv(sp, dsize < 4 ? IRT_INT : dt, IRT_PTR, 0);
+ goto xstore;
+ }
goto conv_I_I;
/* Destination is a floating-point number. */