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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 23190035: Distinguish between malformed and malbounded types (fix issues 12552 and 12554). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/code_generator.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 26663)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -853,7 +853,7 @@
void ValueGraphVisitor::VisitTypeNode(TypeNode* node) {
const AbstractType& type = node->type();
- ASSERT(type.IsFinalized() && !type.IsMalformed());
+ ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded());
if (type.IsInstantiated()) {
ReturnDefinition(new ConstantInstr(type));
} else {
@@ -877,9 +877,9 @@
ASSERT(!dst_type.IsNull());
ASSERT(dst_type.IsFinalized());
- // If the destination type is malformed, a dynamic type error must be thrown
- // at run time.
- if (dst_type.IsMalformed()) {
+ // If the destination type is malformed or malbounded, a dynamic type error
+ // must be thrown at run time.
+ if (dst_type.IsMalformed() || dst_type.IsMalbounded()) {
return false;
}
@@ -1204,7 +1204,7 @@
void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
ASSERT(Token::IsTypeTestOperator(node->kind()));
const AbstractType& type = node->right()->AsTypeNode()->type();
- ASSERT(type.IsFinalized() && !type.IsMalformed());
+ ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded());
const bool negate_result = (node->kind() == Token::kISNOT);
// All objects are instances of type T if Object type is a subtype of type T.
const Type& object_type = Type::Handle(Type::ObjectType());
@@ -1307,7 +1307,7 @@
Append(for_value);
const String& dst_name = String::ZoneHandle(
Symbols::New(Exceptions::kCastErrorDstName));
- if (type.IsMalformed()) {
+ if (type.IsMalformed() || type.IsMalbounded()) {
ReturnValue(BuildAssignableValue(node->token_pos(),
for_value.value(),
type,
@@ -2468,7 +2468,7 @@
Type::New(instantiator_class, type_arguments, token_pos, Heap::kNew));
type ^= ClassFinalizer::FinalizeType(
instantiator_class, type, ClassFinalizer::kFinalize);
- ASSERT(!type.IsMalformed());
+ ASSERT(!type.IsMalformed() && !type.IsMalbounded());
type_arguments = type.arguments();
type_arguments = type_arguments.Canonicalize();
return Bind(new ConstantInstr(type_arguments));
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698