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

Unified Diff: runtime/vm/parser.cc

Issue 2690923004: Only capture function instantiator when compiling local function (fixes #28757). (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 167ea1ea98c23ff637ae53577500ee1c9c714eac..b2a722a1d85561d9560c7a5bedf99524e85d25cc 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -12886,7 +12886,8 @@ AstNode* Parser::ResolveIdent(TokenPosition ident_pos,
if ((resolved == NULL) || (resolved_func_level < type_param_func_level)) {
// The identifier is a function type parameter, possibly shadowing
// 'resolved'.
- if (type_param_func_level < FunctionLevel()) {
+ if ((FunctionLevel() > 0) &&
+ (type_param_func_level < FunctionLevel())) {
// Make sure that the function instantiator is captured.
CaptureFunctionInstantiator();
}
@@ -14360,7 +14361,8 @@ AstNode* Parser::ParsePrimary() {
(primary_func_level < type_param_func_level)) {
// The identifier is a function type parameter, possibly shadowing
// already resolved 'primary'.
- if (type_param_func_level < FunctionLevel()) {
+ if ((FunctionLevel() > 0) &&
+ (type_param_func_level < FunctionLevel())) {
// Make sure that the function instantiator is captured.
CaptureFunctionInstantiator();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698