We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6148b3d commit 052fa21Copy full SHA for 052fa21
1 file changed
lib/preprocessor.cpp
@@ -1072,11 +1072,19 @@ void Preprocessor::simplifyPragmaAsmPrivate(simplecpp::TokenList &tokenList)
1072
break;
1073
}
1074
1075
- const simplecpp::Token * const tok4 = tok3->next;
1076
tok->setstr("asm");
1077
const_cast<simplecpp::Token *>(tok2)->setstr("(");
1078
const_cast<simplecpp::Token *>(tok3)->setstr(")");
1079
- const_cast<simplecpp::Token *>(tok4)->setstr(";");
+
+ 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
1088
while (tok4->next != endasm)
1089
tokenList.deleteToken(tok4->next);
1090
0 commit comments