FFI: ctypeid of ctype object is immutable.

This commit is contained in:
Mike Pall
2012-09-27 14:48:13 +02:00
parent d4d9807f45
commit e013206dd8
2 changed files with 2 additions and 2 deletions

View File

@@ -61,8 +61,7 @@ static CTypeID crec_constructor(jit_State *J, GCcdata *cd, TRef tr)
CTypeID id;
lua_assert(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID);
id = *(CTypeID *)cdataptr(cd);
tr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCcdata)));
tr = emitir(IRT(IR_XLOAD, IRT_INT), tr, 0);
tr = emitir(IRT(IR_FLOAD, IRT_INT), tr, IRFL_CDATA_INT);
emitir(IRTG(IR_EQ, IRT_INT), tr, lj_ir_kint(J, (int32_t)id));
return id;
}