From d62e41fcea8fee5aa69f0875eb4f151abfdcc74e Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Mon, 31 Oct 2016 09:13:55 -0700 Subject: [PATCH] Use old assertion text script in precompiled mode BUG= R=fschneider@google.com Review URL: https://codereview.chromium.org/2466533003 . --- runtime/lib/errors.cc | 9 +++++++++ tests/language/language.status | 3 +++ 2 files changed, 12 insertions(+) diff --git a/runtime/lib/errors.cc b/runtime/lib/errors.cc index b039efa9725..75f354d4f94 100644 --- a/runtime/lib/errors.cc +++ b/runtime/lib/errors.cc @@ -14,6 +14,15 @@ namespace dart { // Scan the stack until we hit the first function in the _AssertionError // class. We then return the next frame's script taking inlining into account. static RawScript* FindScript(DartFrameIterator* iterator) { + if (FLAG_precompiled_runtime) { + // The precompiled runtime faces two issues in recovering the correct + // assertion text. First, the precompiled runtime does not include + // the inlining meta-data so we cannot walk the inline-aware stack trace. + // Second, the script text itself is missing so whatever script is returned + // from here will be missing the assertion expression text. + iterator->NextFrame(); // Skip _AssertionError._checkAssertion frame + return Exceptions::GetCallerScript(iterator); + } StackFrame* stack_frame = iterator->NextFrame(); Code& code = Code::Handle(); Function& func = Function::Handle(); diff --git a/tests/language/language.status b/tests/language/language.status index 34791b41c20..21d3746e5b4 100644 --- a/tests/language/language.status +++ b/tests/language/language.status @@ -148,6 +148,9 @@ issue23244_test: Fail # Issue 23244 [ ($compiler == none || $compiler == precompiler || $compiler == dart2app || $compiler == dart2appjit) && (($runtime == vm || $runtime == dart_precompiled || $runtime == dart_app) || $runtime == drt || $runtime == dartium) && $arch == ia32 ] vm/regress_24517_test: Pass, Fail # Issue 24517. +[ $compiler == precompiler && $runtime == dart_precompiled ] +vm/regress_27671_test: Skip # Unsupported + [ $noopt || $compiler == precompiler ] # Stacktraces in precompilation omit inlined frames. full_stacktrace1_test: Pass, RuntimeError