Mon, 22 Nov 2010 04:54:59 +0000
Adjust pc down by 1 when calculating error lines, pc is always the /next/ instruction
lvm.js | file | annotate | diff | comparison | revisions |
--- a/lvm.js Mon Nov 22 04:54:18 2010 +0000 +++ b/lvm.js Mon Nov 22 04:54:59 2010 +0000 @@ -890,8 +890,8 @@ var currfunc = currframe.f; var sourceName = (currfunc.sourceName||"=<unknown>").substr(1); var line = "?"; - if(currfunc.sourceLines && currfunc.sourceLines[currframe.pc]) - line = currfunc.sourceLines[currframe.pc]; + if(currfunc.sourceLines && currfunc.sourceLines[currframe.pc-1]) + line = currfunc.sourceLines[currframe.pc-1]; sys.print("lvm.js: "+sourceName+":"+line+": "); } sys.puts(e);