changeset 29:00b59dd660f7

check current scope when create __CbC_env
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Sun, 08 Dec 2013 00:47:45 +0900
parents 273f76252412
children 1f391bea5bc8
files tools/clang/lib/Parse/ParseDecl.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tools/clang/lib/Parse/ParseDecl.cpp	Sun Dec 08 00:16:12 2013 +0900
+++ b/tools/clang/lib/Parse/ParseDecl.cpp	Sun Dec 08 00:47:45 2013 +0900
@@ -2876,9 +2876,11 @@
       break;
 #ifndef noCbC
     case tok::kw___code: {
-      //start of creating __CbC_env
-      bool isInvalid__CbC_env = Create__CbC_envStruct(Loc,AS);
-      //end of creating __CbC_env
+      // create __CbC_env
+      bool isInvalid__CbC_env = false;
+      if (getCurScope()->getParent() == NULL)
+	isInvalid__CbC_env = Create__CbC_envStruct(Loc,AS);
+
       if (DS.getSourceRange().isInvalid()) {
 	DS.SetRangeStart(Tok.getLocation());
 	DS.SetRangeEnd(Tok.getLocation());