Index: runtime/vm/flow_graph_compiler_arm.cc |
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc |
index 7e5daa0601f397b13bb31f7d123612bd8b288118..b0b936d6fc1689aee0b9248f93df2531108dcf84 100644 |
--- a/runtime/vm/flow_graph_compiler_arm.cc |
+++ b/runtime/vm/flow_graph_compiler_arm.cc |
@@ -532,6 +532,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 |
@@ -574,7 +579,7 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos, |
const AbstractType& type, |
LocationSummary* locs) { |
ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); |
- ASSERT(!type.IsObjectType() && !type.IsDynamicType() && !type.IsVoidType()); |
+ ASSERT(!type.IsObjectType() && !type.IsDynamicType()); |
const Register kInstantiatorTypeArgumentsReg = R2; |
const Register kFunctionTypeArgumentsReg = R1; |
__ PushList((1 << kInstantiatorTypeArgumentsReg) | |
@@ -653,8 +658,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())); |
const Register kInstantiatorTypeArgumentsReg = R2; |
const Register kFunctionTypeArgumentsReg = R1; |
__ PushList((1 << kInstantiatorTypeArgumentsReg) | |