aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2012-09-27 14:48:13 +0200
committerMike Pall <mike>2012-09-27 14:48:13 +0200
commite013206dd845861c2e27766ada75a98501033cfd (patch)
tree1e8e4f444d15324537a3d92f13442478ac5ebe31
parentd4d9807f45eba1f8fc503831c8ee2577684244bd (diff)
downloadluajit-e013206dd845861c2e27766ada75a98501033cfd.tar.gz
luajit-e013206dd845861c2e27766ada75a98501033cfd.tar.bz2
luajit-e013206dd845861c2e27766ada75a98501033cfd.zip
FFI: ctypeid of ctype object is immutable.
-rw-r--r--src/lj_crecord.c3
-rw-r--r--src/lj_opt_fold.c1
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index 5e91737c..99303310 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -61,8 +61,7 @@ static CTypeID crec_constructor(jit_State *J, GCcdata *cd, TRef tr)
61 CTypeID id; 61 CTypeID id;
62 lua_assert(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID); 62 lua_assert(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID);
63 id = *(CTypeID *)cdataptr(cd); 63 id = *(CTypeID *)cdataptr(cd);
64 tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCcdata))); 64 tr = emitir(IRT(IR_FLOAD, IRT_INT), tr, IRFL_CDATA_INT);
65 tr = emitir(IRT(IR_XLOAD, IRT_INT), tr, 0);
66 emitir(IRTG(IR_EQ, IRT_INT), tr, lj_ir_kint(J, (int32_t)id)); 65 emitir(IRTG(IR_EQ, IRT_INT), tr, lj_ir_kint(J, (int32_t)id));
67 return id; 66 return id;
68} 67}
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index 8f1c8770..c1e30511 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -1992,6 +1992,7 @@ LJFOLDF(fload_cdata_typeid_kgc)
1992 1992
1993/* Get the contents of immutable cdata objects. */ 1993/* Get the contents of immutable cdata objects. */
1994LJFOLD(FLOAD KGC IRFL_CDATA_PTR) 1994LJFOLD(FLOAD KGC IRFL_CDATA_PTR)
1995LJFOLD(FLOAD KGC IRFL_CDATA_INT)
1995LJFOLD(FLOAD KGC IRFL_CDATA_INT64) 1996LJFOLD(FLOAD KGC IRFL_CDATA_INT64)
1996LJFOLDF(fload_cdata_int64_kgc) 1997LJFOLDF(fload_cdata_int64_kgc)
1997{ 1998{