Index: runtime/vm/flow_graph_compiler_ia32.cc |
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc |
index 3751e539890879b058b7e6a07e6dd179d945a5c1..34d3452ec62f1a6a866151c127174e5f7ea80c4b 100644 |
--- a/runtime/vm/flow_graph_compiler_ia32.cc |
+++ b/runtime/vm/flow_graph_compiler_ia32.cc |
@@ -538,6 +538,11 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof( |
Label* is_instance_lbl, |
Label* is_not_instance_lbl) { |
__ Comment("InlineInstanceof"); |
+ if (type.IsVoidType()) { |
+ // A non-null value is returned from a void function, which will result in a |
+ // type error. A null value is handled prior to executing this inline code. |
+ return SubtypeTestCache::null(); |
+ } |
if (type.IsInstantiated()) { |
const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); |
// A class equality check is only applicable with a dst type (not a |
@@ -580,7 +585,7 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos, |
const AbstractType& type, |
LocationSummary* locs) { |
ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded()); |
- ASSERT(!type.IsObjectType() && !type.IsDynamicType() && !type.IsVoidType()); |
+ ASSERT(!type.IsObjectType() && !type.IsDynamicType()); |
__ pushl(EDX); // Store instantiator type arguments. |
__ pushl(ECX); // Store function type arguments. |
@@ -661,8 +666,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(TokenPosition token_pos, |
ASSERT(dst_type.IsFinalized()); |
// Assignable check is skipped in FlowGraphBuilder, not here. |
ASSERT(dst_type.IsMalformedOrMalbounded() || |
- (!dst_type.IsDynamicType() && !dst_type.IsObjectType() && |
- !dst_type.IsVoidType())); |
+ (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); |
__ pushl(EDX); // Store instantiator type arguments. |
__ pushl(ECX); // Store function type arguments. |
// A null object is always assignable and is returned as result. |