FFI: Add callback support (for x86/x64).

This commit is contained in:
Mike Pall
2011-11-14 14:15:57 +01:00
parent e9eb4fdb4a
commit 71d00a56db
27 changed files with 5469 additions and 4472 deletions

View File

@@ -107,6 +107,7 @@ BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc)
const void *lineinfo = proto_lineinfo(pt);
if (pc < pt->sizebc && lineinfo) {
BCLine first = pt->firstline;
if (pc == pt->sizebc-1) return first + pt->numline;
if (pc-- == 0) return first;
if (pt->numline < 256)
return first + (BCLine)((const uint8_t *)lineinfo)[pc];
@@ -124,7 +125,7 @@ static BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe)
BCPos pc = debug_framepc(L, fn, nextframe);
if (pc != NO_BCPOS) {
GCproto *pt = funcproto(fn);
lua_assert(pc < pt->sizebc);
lua_assert(pc <= pt->sizebc);
return lj_debug_line(pt, pc);
}
return -1;