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

Unified Diff: runtime/vm/flow_graph_compiler_dbc.cc

Issue 2406383002: DBC: Pull BadTypeError out of AssertAssignable (Closed)
Patch Set: Add comment Created 4 years, 2 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 | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_dbc.cc
diff --git a/runtime/vm/flow_graph_compiler_dbc.cc b/runtime/vm/flow_graph_compiler_dbc.cc
index aa6efacef9624211156fd6862f2bbabd20512915..fad3bd807b5d51a30c724215ff89f10fefd468d8 100644
--- a/runtime/vm/flow_graph_compiler_dbc.cc
+++ b/runtime/vm/flow_graph_compiler_dbc.cc
@@ -230,7 +230,13 @@ void FlowGraphCompiler::GenerateAssertAssignable(TokenPosition token_pos,
}
__ PushConstant(dst_type);
__ PushConstant(dst_name);
- __ AssertAssignable(__ AddConstant(test_cache));
+
+ if (dst_type.IsMalformedOrMalbounded()) {
+ __ BadTypeError();
+ } else {
+ __ AssertAssignable(__ AddConstant(test_cache));
+ }
+
if (is_optimizing()) {
// Register allocator does not think that our first input (also used as
// output) needs to be kept alive across the call because that is how code
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698