diff options
-rw-r--r-- | src/lj_crecord.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index 78e999f2..875160cc 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -651,7 +651,13 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval) | |||
651 | sid = argv2cdata(J, sp, sval)->ctypeid; | 651 | sid = argv2cdata(J, sp, sval)->ctypeid; |
652 | s = ctype_raw(cts, sid); | 652 | s = ctype_raw(cts, sid); |
653 | svisnz = cdataptr(cdataV(sval)); | 653 | svisnz = cdataptr(cdataV(sval)); |
654 | t = crec_ct2irt(cts, s); | 654 | if (ctype_isfunc(s->info)) { |
655 | sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR); | ||
656 | s = ctype_get(cts, sid); | ||
657 | t = IRT_PTR; | ||
658 | } else { | ||
659 | t = crec_ct2irt(cts, s); | ||
660 | } | ||
655 | if (ctype_isptr(s->info)) { | 661 | if (ctype_isptr(s->info)) { |
656 | sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_PTR); | 662 | sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_PTR); |
657 | if (ctype_isref(s->info)) { | 663 | if (ctype_isref(s->info)) { |