Index: runtime/vm/kernel_to_il.cc |
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc |
index 2f1b8f2a7ce029b43c95a813ed8ec33b61f86d47..e5d75e77ec317bfbf199602d5f52d3383231451b 100644 |
--- a/runtime/vm/kernel_to_il.cc |
+++ b/runtime/vm/kernel_to_il.cc |
@@ -3953,7 +3953,7 @@ void DartTypeTranslator::VisitFunctionType(FunctionType* node) { |
// So we convert malformed return/parameter types to `dynamic`. |
TypeParameterScope scope(this, &node->type_parameters()); |
- const Function& signature_function = Function::ZoneHandle( |
+ Function& signature_function = Function::ZoneHandle( |
Z, Function::NewSignatureFunction(*active_class_->klass, |
TokenPosition::kNoSource)); |
@@ -4008,8 +4008,10 @@ void DartTypeTranslator::VisitFunctionType(FunctionType* node) { |
if (finalize_) { |
signature_type ^= ClassFinalizer::FinalizeType( |
*active_class_->klass, signature_type, ClassFinalizer::kCanonicalize); |
+ // Do not refer to signature_function anymore, since it may have been |
+ // replaced during canonicalization. |
+ signature_function = Function::null(); |
} |
- signature_function.SetSignatureType(signature_type); |
regis
2016/12/28 22:12:18
This statement was setting the signature type on t
|
result_ = signature_type.raw(); |
} |