Quellcode durchsuchen

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 vor 13 Jahren
Ursprung
Commit
95976be7d4
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  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 SQFunctionProto::GetLine(SQInstruction *curr)
-{
+{
     SQInteger op = (SQInteger)(curr-_instructions);
     SQInteger op = (SQInteger)(curr-_instructions);
     SQInteger low = 0;
     SQInteger low = 0;
     SQInteger high = _nlineinfos - 1;
     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;
     return _lineinfos[mid]._line;
 }
 }