summaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
authorMike Pall <mike>2014-04-08 12:10:51 +0200
committerMike Pall <mike>2014-04-08 12:10:51 +0200
commit4ed3ee1f046618c5251baae3013f125b4cc7ca9c (patch)
tree49db7722bac6e6be8db60b3bc3e2791b9047512f /src/lj_crecord.c
parent111b2e8711366b40161b4530f5f0a4fd08dc3420 (diff)
downloadluajit2-4ed3ee1f046618c5251baae3013f125b4cc7ca9c.tar.gz
FFI: Fix cdata equality comparison against strings.
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index 71f3d069..8612f005 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -1421,7 +1421,9 @@ void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd)
ct = ctype_child(cts, cct);
tr = lj_ir_kint(J, (int32_t)ofs);
} /* else: interpreter will throw. */
- } /* else: interpreter will throw. */
+ } else {
+ tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCstr)));
+ }
} else if (!tref_isnum(tr)) {
tr = 0;
}