зеркало из https://github.com/mozilla/pjs.git
Fix js_LineNumberToPC based on MikeM@RetekSolutions.com's input (313922, r=mrbkap).
This commit is contained in:
Родитель
7bc5bb6a89
Коммит
1cc09d0eb3
|
@ -1632,9 +1632,13 @@ js_LineNumberToPC(JSScript *script, uintN target)
|
|||
lineno = script->lineno;
|
||||
bestdiff = SN_LINE_LIMIT;
|
||||
for (sn = SCRIPT_NOTES(script); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
if (lineno == target)
|
||||
/*
|
||||
* Exact-match only if offset is not in the prolog; otherwise use
|
||||
* nearest greater-or-equal line number match.
|
||||
*/
|
||||
if (lineno == target && script->code + offset >= script->main)
|
||||
goto out;
|
||||
if (lineno > target) {
|
||||
if (lineno >= target) {
|
||||
diff = lineno - target;
|
||||
if (diff < bestdiff) {
|
||||
bestdiff = diff;
|
||||
|
|
Загрузка…
Ссылка в новой задаче