diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_carith.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lj_carith.c b/src/lj_carith.c index df5f801e..9bea0a33 100644 --- a/src/lj_carith.c +++ b/src/lj_carith.c | |||
| @@ -44,9 +44,13 @@ static int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca) | |||
| 44 | p = (uint8_t *)cdata_getptr(p, ct->size); | 44 | p = (uint8_t *)cdata_getptr(p, ct->size); |
| 45 | if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); | 45 | if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); |
| 46 | } else if (ctype_isfunc(ct->info)) { | 46 | } else if (ctype_isfunc(ct->info)) { |
| 47 | CTypeID id0 = i ? ctype_typeid(cts, ca->ct[0]) : 0; | ||
| 47 | p = (uint8_t *)*(void **)p; | 48 | p = (uint8_t *)*(void **)p; |
| 48 | ct = ctype_get(cts, | 49 | ct = ctype_get(cts, |
| 49 | lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR)); | 50 | lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR)); |
| 51 | if (i) { /* cts->tab may have been reallocated. */ | ||
| 52 | ca->ct[0] = ctype_get(cts, id0); | ||
| 53 | } | ||
| 50 | } | 54 | } |
| 51 | if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); | 55 | if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct); |
| 52 | ca->ct[i] = ct; | 56 | ca->ct[i] = ct; |
