зеркало из https://github.com/mozilla/gecko-dev.git
Fix js_LineNumberToPC based on MikeM@RetekSolutions.com's input (313922, r=mrbkap).
This commit is contained in:
Родитель
091b286350
Коммит
f94795401a
|
@ -1632,9 +1632,13 @@ js_LineNumberToPC(JSScript *script, uintN target)
|
||||||
lineno = script->lineno;
|
lineno = script->lineno;
|
||||||
bestdiff = SN_LINE_LIMIT;
|
bestdiff = SN_LINE_LIMIT;
|
||||||
for (sn = SCRIPT_NOTES(script); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
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;
|
goto out;
|
||||||
if (lineno > target) {
|
if (lineno >= target) {
|
||||||
diff = lineno - target;
|
diff = lineno - target;
|
||||||
if (diff < bestdiff) {
|
if (diff < bestdiff) {
|
||||||
bestdiff = diff;
|
bestdiff = diff;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче