Commit 3b89eef9 authored by zerny@chromium.org's avatar zerny@chromium.org

Blink GC plugin: look for checked namespaces within the list of namespaces.

Previously only the innermost namespace was matched against causing structures in, eg, namespace WebCore::Foo to not be checked.

BUG=334149
R=haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/294903002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271608 0039d316-1c4b-4281-b951-d872f2087c98
parent 2e886e39
...@@ -1060,12 +1060,14 @@ class BlinkGCPluginConsumer : public ASTConsumer { ...@@ -1060,12 +1060,14 @@ class BlinkGCPluginConsumer : public ASTConsumer {
DeclContext* context = info->record()->getDeclContext(); DeclContext* context = info->record()->getDeclContext();
if (context->isRecord()) if (context->isRecord())
return InCheckedNamespace(cache_.Lookup(context)); return InCheckedNamespace(cache_.Lookup(context));
if (context->isNamespace()) { while (context->isNamespace()) {
const NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context); NamespaceDecl* decl = dyn_cast<NamespaceDecl>(context);
if (decl->isAnonymousNamespace()) if (decl->isAnonymousNamespace())
return false; return false;
return options_.checked_namespaces.find(decl->getNameAsString()) != if (options_.checked_namespaces.find(decl->getNameAsString()) !=
options_.checked_namespaces.end(); options_.checked_namespaces.end())
return true;
context = decl->getDeclContext();
} }
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment