ソースを参照

The line numbers shown on stack dumps was still showing wrong results on some cases, this is a try to fix it without go back to linear scan.

mingodad 13 年 前
コミット
95976be7d4
1 ファイル変更2 行追加2 行削除
  1. 2 2
      SquiLu/squirrel/sqobject.cpp

+ 2 - 2
SquiLu/squirrel/sqobject.cpp

@@ -222,7 +222,7 @@ const SQChar* SQFunctionProto::GetLocal(SQVM *vm,SQUnsignedInteger stackbase,SQU
 
 
 SQInteger SQFunctionProto::GetLine(SQInstruction *curr)
-{
+{
     SQInteger op = (SQInteger)(curr-_instructions);
     SQInteger low = 0;
     SQInteger high = _nlineinfos - 1;
@@ -247,7 +247,7 @@ SQInteger SQFunctionProto::GetLine(SQInstruction *curr)
         }
     }
 
-    while(_lineinfos[mid]._op >= op && mid >= 0) mid--;
+    while(_lineinfos[mid]._op > op && mid >= 0) mid--;
 
     return _lineinfos[mid]._line;
 }