diff options
author | Mike Pall <mike> | 2015-12-28 13:02:35 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2015-12-28 13:02:35 +0100 |
commit | 20f4141b1a4abbb42b61b87cc3b52906acb12f0e (patch) | |
tree | 19ad75159213a32751bd0e6de3b6c672dbafe33c /src/lj_snap.c | |
parent | 0345f361531c756367257eb2f147c707e1710218 (diff) | |
download | luajit-20f4141b1a4abbb42b61b87cc3b52906acb12f0e.tar.gz luajit-20f4141b1a4abbb42b61b87cc3b52906acb12f0e.tar.bz2 luajit-20f4141b1a4abbb42b61b87cc3b52906acb12f0e.zip |
FFI: Properly unsink non-standard cdata allocations.
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r-- | src/lj_snap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 7c78f8a3..62515ed0 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -711,8 +711,9 @@ static void snap_unsink(jit_State *J, GCtrace *T, ExitState *ex, | |||
711 | if (ir->o == IR_CNEW || ir->o == IR_CNEWI) { | 711 | if (ir->o == IR_CNEW || ir->o == IR_CNEWI) { |
712 | CTState *cts = ctype_cts(J->L); | 712 | CTState *cts = ctype_cts(J->L); |
713 | CTypeID id = (CTypeID)T->ir[ir->op1].i; | 713 | CTypeID id = (CTypeID)T->ir[ir->op1].i; |
714 | CTSize sz = lj_ctype_size(cts, id); | 714 | CTSize sz; |
715 | GCcdata *cd = lj_cdata_new(cts, id, sz); | 715 | CTInfo info = lj_ctype_info(cts, id, &sz); |
716 | GCcdata *cd = lj_cdata_newx(cts, id, sz, info); | ||
716 | setcdataV(J->L, o, cd); | 717 | setcdataV(J->L, o, cd); |
717 | if (ir->o == IR_CNEWI) { | 718 | if (ir->o == IR_CNEWI) { |
718 | uint8_t *p = (uint8_t *)cdataptr(cd); | 719 | uint8_t *p = (uint8_t *)cdataptr(cd); |