From 3b89eef9d7ecb2bffe65250fb99e741fb56abe66 Mon Sep 17 00:00:00 2001 From: "zerny@chromium.org" Date: Tue, 20 May 2014 07:30:32 +0000 Subject: [PATCH] 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 --- tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp index 4b023c3a9d46..31a83e8f2ddb 100644 --- a/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp +++ b/tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp @@ -1060,12 +1060,14 @@ class BlinkGCPluginConsumer : public ASTConsumer { DeclContext* context = info->record()->getDeclContext(); if (context->isRecord()) return InCheckedNamespace(cache_.Lookup(context)); - if (context->isNamespace()) { - const NamespaceDecl* decl = dyn_cast(context); + while (context->isNamespace()) { + NamespaceDecl* decl = dyn_cast(context); if (decl->isAnonymousNamespace()) return false; - return options_.checked_namespaces.find(decl->getNameAsString()) != - options_.checked_namespaces.end(); + if (options_.checked_namespaces.find(decl->getNameAsString()) != + options_.checked_namespaces.end()) + return true; + context = decl->getDeclContext(); } return false; } -- 2.11.4.GIT