summaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index d689b81b..c93cece3 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -503,10 +503,17 @@ void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd)
503 IRType t; 503 IRType t;
504 if (ctype_isenum(ctk->info)) ctk = ctype_child(cts, ctk); 504 if (ctype_isenum(ctk->info)) ctk = ctype_child(cts, ctk);
505 if (ctype_isinteger(ctk->info) && (t = crec_ct2irt(ctk)) != IRT_CDATA) { 505 if (ctype_isinteger(ctk->info) && (t = crec_ct2irt(ctk)) != IRT_CDATA) {
506 idx = emitir(IRT(IR_ADD, IRT_PTR), idx, lj_ir_kintp(J, sizeof(GCcdata))); 506 if (ctk->size == 8) {
507 idx = emitir(IRT(IR_XLOAD, t), idx, 0); 507 idx = emitir(IRT(IR_FLOAD, t), idx, IRFL_CDATA_INT64);
508 if (!LJ_64 && (t == IRT_I64 || t == IRT_U64)) { 508 } else {
509 idx = emitconv(idx, IRT_INT, t, 0); 509 idx = emitir(IRT(IR_ADD, IRT_PTR), idx,
510 lj_ir_kintp(J, sizeof(GCcdata)));
511 idx = emitir(IRT(IR_XLOAD, t), idx, 0);
512 }
513 if (LJ_64 && ctk->size < sizeof(intptr_t) && !(ctk->info & CTF_UNSIGNED))
514 idx = emitconv(idx, IRT_INTP, IRT_INT, IRCONV_SEXT);
515 if (!LJ_64 && ctk->size > sizeof(intptr_t)) {
516 idx = emitconv(idx, IRT_INTP, t, 0);
510 lj_needsplit(J); 517 lj_needsplit(J);
511 } 518 }
512 goto integer_key; 519 goto integer_key;