https://github.com/perry-ca created https://github.com/llvm/llvm-project/pull/177979
The changes in https://github.com/llvm/llvm-project/pull/141671 had a failure in some asan bots. The code for parsing pragma export is the same as for the MS pragmas. I did noticed that the MS pragma handling code says the tokens are reinjected when calling EnterTokenStream(). Do the same for pragma export. The tokens on the MS pragma and pragma export are handled by: 1. PragmaMSPragma::HandlePragma - collect the tokens into an array - an annotated token is created with the pragma token & array of tokens - calls EnterToken() adds the annotated token 2. Parser::HandlePragmaMSPragma() - takes the array of tokens off the annotated token can adds them to the stream using EnterTokenStream() - this call says the tokens are reinjected. >From e339864ac7d30c34b94181a1af17ec951b3c12e0 Mon Sep 17 00:00:00 2001 From: Sean Perry <[email protected]> Date: Mon, 26 Jan 2026 10:33:38 -0500 Subject: [PATCH] mark the tokens as reinjected --- clang/lib/Parse/ParsePragma.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp index 54b96fd2102b5..3d7e7b5d8ac49 100644 --- a/clang/lib/Parse/ParsePragma.cpp +++ b/clang/lib/Parse/ParsePragma.cpp @@ -1412,7 +1412,7 @@ void Parser::zOSHandlePragmaHelper(tok::TokenKind PragmaKind) { auto *TheTokens = (std::pair<std::unique_ptr<Token[]>, size_t> *)Tok.getAnnotationValue(); PP.EnterTokenStream(std::move(TheTokens->first), TheTokens->second, true, - false); + /*IsReinject=*/true); ConsumeAnnotationToken(); llvm::scope_exit OnReturn([this]() { _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
