Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Unified Diff: runtime/lib/errors.cc

Issue 1654153002: Introduce a flag to force program abort on type/assertion errors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/exceptions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/errors.cc
diff --git a/runtime/lib/errors.cc b/runtime/lib/errors.cc
index aa985da68c3127bd66d261e8d0542235f45cf91f..434143b30e3de86ec39258dcad8448464867184f 100644
--- a/runtime/lib/errors.cc
+++ b/runtime/lib/errors.cc
@@ -10,11 +10,17 @@
namespace dart {
+DECLARE_FLAG(bool, abort_on_assertion_errors);
+
// Allocate and throw a new AssertionError.
// Arg0: index of the first token of the failed assertion.
// Arg1: index of the first token after the failed assertion.
// Return value: none, throws an exception.
DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 2) {
+ if (FLAG_abort_on_assertion_errors) {
+ Exceptions::PrintStackTraceAndAbort("an assertion failure");
+ }
+
// No need to type check the arguments. This function can only be called
// internally from the VM.
intptr_t assertion_start =
« no previous file with comments | « no previous file | runtime/vm/exceptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698