diff options
author | Mike Pall <mike> | 2011-11-14 14:15:57 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-11-14 14:18:25 +0100 |
commit | 71d00a56dbab6c29c0346093dbe530d7b7608be4 (patch) | |
tree | 5e28e19b4d2f20168d5ee0e4fe500b1e2b233c1c /src/lj_debug.c | |
parent | e9eb4fdb4a08baaa2d9190187a6c38d5b3f8b091 (diff) | |
download | luajit-71d00a56dbab6c29c0346093dbe530d7b7608be4.tar.gz luajit-71d00a56dbab6c29c0346093dbe530d7b7608be4.tar.bz2 luajit-71d00a56dbab6c29c0346093dbe530d7b7608be4.zip |
FFI: Add callback support (for x86/x64).
Diffstat (limited to 'src/lj_debug.c')
-rw-r--r-- | src/lj_debug.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_debug.c b/src/lj_debug.c index 699fca28..4038e209 100644 --- a/src/lj_debug.c +++ b/src/lj_debug.c | |||
@@ -107,6 +107,7 @@ BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc) | |||
107 | const void *lineinfo = proto_lineinfo(pt); | 107 | const void *lineinfo = proto_lineinfo(pt); |
108 | if (pc < pt->sizebc && lineinfo) { | 108 | if (pc < pt->sizebc && lineinfo) { |
109 | BCLine first = pt->firstline; | 109 | BCLine first = pt->firstline; |
110 | if (pc == pt->sizebc-1) return first + pt->numline; | ||
110 | if (pc-- == 0) return first; | 111 | if (pc-- == 0) return first; |
111 | if (pt->numline < 256) | 112 | if (pt->numline < 256) |
112 | return first + (BCLine)((const uint8_t *)lineinfo)[pc]; | 113 | return first + (BCLine)((const uint8_t *)lineinfo)[pc]; |
@@ -124,7 +125,7 @@ static BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe) | |||
124 | BCPos pc = debug_framepc(L, fn, nextframe); | 125 | BCPos pc = debug_framepc(L, fn, nextframe); |
125 | if (pc != NO_BCPOS) { | 126 | if (pc != NO_BCPOS) { |
126 | GCproto *pt = funcproto(fn); | 127 | GCproto *pt = funcproto(fn); |
127 | lua_assert(pc < pt->sizebc); | 128 | lua_assert(pc <= pt->sizebc); |
128 | return lj_debug_line(pt, pc); | 129 | return lj_debug_line(pt, pc); |
129 | } | 130 | } |
130 | return -1; | 131 | return -1; |