File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1072,11 +1072,19 @@ void Preprocessor::simplifyPragmaAsmPrivate(simplecpp::TokenList &tokenList)
10721072 break ;
10731073 }
10741074
1075- const simplecpp::Token * const tok4 = tok3->next ;
10761075 tok->setstr (" asm" );
10771076 const_cast <simplecpp::Token *>(tok2)->setstr (" (" );
10781077 const_cast <simplecpp::Token *>(tok3)->setstr (" )" );
1079- const_cast <simplecpp::Token *>(tok4)->setstr (" ;" );
1078+
1079+ simplecpp::Token * tok4;
1080+ if (tok3->next ) {
1081+ tok4 = tok3->next ;
1082+ tok4->setstr (" ;" );
1083+ } else {
1084+ tok4 = new simplecpp::Token (" ;" , tok3->location );
1085+ const_cast <simplecpp::Token *>(tok3)->next = tok4;
1086+ }
1087+
10801088 while (tok4->next != endasm)
10811089 tokenList.deleteToken (tok4->next );
10821090 }
You can’t perform that action at this time.
0 commit comments