changeset 202:d6e4c9eda2cc

...ZZ
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 04 Jun 2021 23:22:07 +0900
parents a96fbbdf2d0f
children 0d4b2609c30f
files clang/lib/Parse/ParseCbC.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/clang/lib/Parse/ParseCbC.cpp	Fri Jun 04 21:07:06 2021 +0900
+++ b/clang/lib/Parse/ParseCbC.cpp	Fri Jun 04 23:22:07 2021 +0900
@@ -240,12 +240,17 @@
   if (innerRes.isUsable())
     CompoundStmts.push_back(innerRes.get());
 
+  ConsumeAnyToken(); // eat the '__environment'.
+  Token TokSave = Tok;
+  SourceLocation PLocSave = PrevTokLocation;
   // jmp_buf env_buf;   --> int env_buf[64];
   Tok = PP.ReadFromString("int env_buf[64];",Loc);
   ConsumeAnyToken();
   // innerRes = CreateDeclStmt(bufII, false, false, 64, DeclSpec::TST_typename, CreateIdentifierInfo("int", Loc));
   StmtVector Stmts;
   innerRes = ParseStatementOrDeclaration(Stmts,( ParsedStmtContext::Compound | ParsedStmtContext::AllowDeclarationsInC));
+  Tok = TokSave ;
+  PrevTokLocation= PLocSave ;
   if (innerRes.isUsable())
     CompoundStmts.push_back(innerRes.get());
 
@@ -270,7 +275,6 @@
     CompoundStmts.push_back(innerRes.get());
 
   StmtResult CompoundStmtRes = Actions.ActOnCompoundStmt(Loc,Loc,CompoundStmts,true);
-  ConsumeAnyToken(); // eat the '__environment'.
   Result =  Actions.ActOnStmtExpr(getCurScope() ,Loc, CompoundStmtRes.get(), Loc);
 
   // cast