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

Unified Diff: pkg/analyzer/lib/src/dart/resolver/scope.dart

Issue 2047273004: Add bounds check in scope lookup (issue 26633) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/resolver/scope.dart
diff --git a/pkg/analyzer/lib/src/dart/resolver/scope.dart b/pkg/analyzer/lib/src/dart/resolver/scope.dart
index e90ba8619d8c29e80b562fab5adc395d6b216e2f..04da23d2409956ff40c60c03491573db05c80946 100644
--- a/pkg/analyzer/lib/src/dart/resolver/scope.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/scope.dart
@@ -994,7 +994,7 @@ class PrefixedNamespace implements Namespace {
@override
Element get(String name) {
- if (name.startsWith(_prefix)) {
+ if (name.length > _length && name.startsWith(_prefix)) {
if (name.codeUnitAt(_length) == '.'.codeUnitAt(0)) {
return _definedNames[name.substring(_length + 1)];
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698