Generate super.noSuchMethod if super call is malformed

This doesn't fix all of the errors with 
'Error: ".function" called on null' stacktraces. 

Change-Id: I7ddc0405db7e2f028eb27028c854dab29a0adf16
Reviewed-on: https://dart-review.googlesource.com/5522
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
This commit is contained in:
Harry Terkelsen 2017-09-15 20:03:51 +00:00 committed by commit-bot@chromium.org
parent c759ea8e69
commit 3a25ead178
4 changed files with 31 additions and 44 deletions

View file

@ -3315,6 +3315,13 @@ class KernelSsaGraphBuilder extends ir.Visitor
@override
void visitSuperMethodInvocation(ir.SuperMethodInvocation invocation) {
if (invocation.interfaceTarget == null) {
var selector = _elementMap.getSelector(invocation);
var arguments =
_visitArgumentsForDynamicTarget(selector, invocation.arguments);
_generateSuperNoSuchMethod(invocation, selector.name, arguments);
return;
}
List<HInstruction> arguments = _visitArgumentsForStaticTarget(
invocation.interfaceTarget.function, invocation.arguments);
_buildInvokeSuper(

View file

@ -425,6 +425,7 @@ class KernelImpactBuilder extends ir.Visitor {
elementAdapter.getSuperNoSuchMethod(
elementAdapter.getClass(currentMember.enclosingClass)),
CallStructure.ONE_ARG));
impactBuilder.registerFeature(Feature.SUPER_NO_SUCH_METHOD);
}
}

View file

@ -718,7 +718,7 @@ method_override5_test: RuntimeError
method_override7_test/00: MissingCompileTimeError
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
method_override8_test/00: Crash # type 'ShadowField' is not a subtype of type 'Procedure' of 'value' where
method_override8_test/00: MissingCompileTimeError
method_override8_test/01: MissingCompileTimeError
mint_arithmetic_test: RuntimeError
mixin_black_listed_test/02: MissingCompileTimeError
@ -730,9 +730,11 @@ mixin_illegal_super_use_test/01: MissingCompileTimeError
mixin_illegal_super_use_test/02: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/03: Crash # Assertion failure: Missing scope info for j:method(createInvocationMirror).
mixin_illegal_super_use_test/04: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#inner)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/04: MissingCompileTimeError
mixin_illegal_super_use_test/05: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/06: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#inner)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/07: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/07: MissingCompileTimeError
mixin_illegal_super_use_test/08: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/09: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/10: MissingCompileTimeError
@ -867,12 +869,12 @@ null_test/03: Crash # 'file:*/pkg/compiler/lib/src/ssa/type_builder.dart': Faile
null_test/none: Crash # 'file:*/pkg/compiler/lib/src/ssa/type_builder.dart': Failed assertion: line 141 pos 12: 'member.isInstanceMember': is not true.
number_identity2_test: RuntimeError
numbers_test: RuntimeError
override_field_method1_negative_test: Crash # type 'ShadowField' is not a subtype of type 'Procedure' of 'value' where
override_field_method1_negative_test: Fail
override_field_method2_negative_test: Fail
override_field_method4_negative_test: Fail
override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_inheritance_mixed_test/01: Crash # type 'ShadowField' is not a subtype of type 'Procedure' of 'value' where
override_inheritance_mixed_test/01: MissingCompileTimeError
override_inheritance_mixed_test/02: MissingCompileTimeError
override_inheritance_mixed_test/03: MissingCompileTimeError
override_inheritance_mixed_test/04: MissingCompileTimeError
@ -941,24 +943,14 @@ string_join_test: RuntimeError
super_bound_closure_test/01: RuntimeError
super_bound_closure_test/none: RuntimeError
super_call4_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/04: MissingCompileTimeError
mixin_illegal_super_use_test/07: MissingCompileTimeError
super_getter_setter_test: RuntimeError
super_no_such_method1_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_no_such_method4_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_no_such_method5_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index5_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index6_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index7_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index8_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/02: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/03: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/04: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/05: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/06: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/07: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index5_test: RuntimeError
super_operator_index6_test: RuntimeError
super_operator_index7_test: RuntimeError
super_operator_index8_test: RuntimeError
mixin_illegal_super_use_test/02: MissingCompileTimeError
mixin_illegal_super_use_test/05: MissingCompileTimeError
mixin_illegal_super_use_test/08: MissingCompileTimeError
super_setter_interceptor_test: RuntimeError
super_test: RuntimeError
switch_bad_case_test/01: MissingCompileTimeError
@ -1227,7 +1219,7 @@ internal_library_test/02: Crash # NoSuchMethodError: Class 'DillLibraryBuilder'
invocation_mirror2_test: RuntimeError
invocation_mirror_empty_arguments_test: RuntimeError
invocation_mirror_invoke_on2_test: RuntimeError
invocation_mirror_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
invocation_mirror_test: RuntimeError
is_malformed_type_test/94: Crash # Internal Error: Non-empty instruction stack
is_malformed_type_test/96: Crash # Internal Error: Non-empty instruction stack
is_malformed_type_test/98: Crash # Internal Error: Non-empty instruction stack
@ -1286,9 +1278,11 @@ mixin_illegal_super_use_test/01: MissingCompileTimeError
mixin_illegal_super_use_test/02: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/03: Crash # NoSuchMethodError: The method 'localIsUsedInTryOrSync' was called on null.
mixin_illegal_super_use_test/04: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#inner)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/04: MissingCompileTimeError
mixin_illegal_super_use_test/05: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/06: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#inner)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/07: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/07: MissingCompileTimeError
mixin_illegal_super_use_test/08: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/09: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(P0.foo#)) for j:closure_call(P0_foo_closure.call).
mixin_illegal_super_use_test/10: MissingCompileTimeError
@ -1495,24 +1489,14 @@ string_join_test: RuntimeError
super_bound_closure_test/01: RuntimeError
super_bound_closure_test/none: RuntimeError
super_call4_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
mixin_illegal_super_use_test/04: MissingCompileTimeError
mixin_illegal_super_use_test/07: MissingCompileTimeError
super_getter_setter_test: RuntimeError
super_no_such_method1_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_no_such_method4_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_no_such_method5_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index5_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index6_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index7_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index8_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/01: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/02: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/03: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/04: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/05: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/06: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index_test/07: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_test: Crash # NoSuchMethodError: The getter 'function' was called on null.
super_operator_index5_test: RuntimeError
super_operator_index6_test: RuntimeError
super_operator_index7_test: RuntimeError
super_operator_index8_test: RuntimeError
mixin_illegal_super_use_test/02: MissingCompileTimeError
mixin_illegal_super_use_test/05: MissingCompileTimeError
mixin_illegal_super_use_test/08: MissingCompileTimeError
super_setter_interceptor_test: RuntimeError
super_test: RuntimeError
switch_bad_case_test/01: MissingCompileTimeError

View file

@ -656,19 +656,14 @@ const_types_test/39: Crash # type 'InterfaceType' is not a subtype of type 'Reso
const_types_test/40: Crash # type 'InterfaceType' is not a subtype of type 'ResolutionInterfaceType' of 'type1' where
const_types_test/none: Crash # type 'InterfaceType' is not a subtype of type 'ResolutionInterfaceType' of 'type1' where
constants_test/05: MissingCompileTimeError
constructor12_test: RuntimeError
constructor2_test: RuntimeError
constructor3_test: RuntimeError
constructor5_test: RuntimeError
constructor6_test: Crash # Assertion failure: Cannot find value parameter(A.#arg) in (parameter(C.#x), parameter(C.#y), parameter(B.#arg), BoxLocal(_box_0)) for j:constructor(C.).
constructor8_test: RuntimeError
constructor_duplicate_final_test/01: Crash # Internal problem: No constructor named '_DuplicatedFieldInitializerError::' in 'dart:core'.
constructor_duplicate_final_test/02: Crash # Internal problem: No constructor named '_DuplicatedFieldInitializerError::' in 'dart:core'.
constructor_duplicate_final_test/03: Crash # Internal problem: No constructor named '_DuplicatedFieldInitializerError::' in 'dart:core'.
custom_await_stack_trace_test: Crash # RangeError (index): Invalid value: Not in range 0..2, inclusive: 3
cyclic_constructor_test/01: Crash # Stack Overflow
cyclic_default_values_test: RuntimeError
dangling_else_test: Crash # RangeError (index): Invalid value: Valid value range is empty: 0
bad_override_test/04: MissingCompileTimeError
deferred_call_empty_before_load_test: RuntimeError
deferred_closurize_load_library_test: CompileTimeError
deferred_constant_list_test: CompileTimeError