File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1058,6 +1058,7 @@ void Preprocessor::simplifyPragmaAsmPrivate(simplecpp::TokenList &tokenList)
10581058 continue ;
10591059
10601060 const simplecpp::Token *endasm = tok3;
1061+ bool foundEndasm = false ;
10611062 while ((endasm = endasm->next ) != nullptr ) {
10621063 if (endasm->op != ' #' || sameline (endasm,endasm->previousSkipComments ()))
10631064 continue ;
@@ -1069,9 +1070,13 @@ void Preprocessor::simplifyPragmaAsmPrivate(simplecpp::TokenList &tokenList)
10691070 continue ;
10701071 while (sameline (endasm,endasm3))
10711072 endasm = endasm->next ;
1073+ foundEndasm = true ;
10721074 break ;
10731075 }
10741076
1077+ if (!foundEndasm)
1078+ throw InternalError (nullptr , " syntax error: missing #pragma endasm" , InternalError::SYNTAX);
1079+
10751080 const simplecpp::Token * const tok4 = tok3->next ;
10761081 tok->setstr (" asm" );
10771082 const_cast <simplecpp::Token *>(tok2)->setstr (" (" );
You can’t perform that action at this time.
0 commit comments