From: Pierre-Emmanuel Patry Date: Mon, 11 Aug 2025 14:22:32 +0000 (+0200) Subject: gccrs: Fix infinite loop on inline assembly clobbers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0137edd2597d6d76ea9e901d3a6d81744f6cf9eb;p=thirdparty%2Fgcc.git gccrs: Fix infinite loop on inline assembly clobbers Fix Rust-GCC/gccrs#4046 where the inline llvm_asm macro parser did not expect a comma. gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_llvm_clobbers): Expect a comma between clobbers. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc index 4080a22cfae..6cbcf87ebc9 100644 --- a/gcc/rust/expand/rust-macro-builtins-asm.cc +++ b/gcc/rust/expand/rust-macro-builtins-asm.cc @@ -1125,8 +1125,11 @@ parse_llvm_clobbers (LlvmAsmContext &ctx) { ctx.llvm_asm.get_clobbers ().push_back ( {strip_double_quotes (token->as_string ()), token->get_locus ()}); + + parser.skip_token (STRING_LITERAL); } - parser.skip_token (STRING_LITERAL); + + parser.maybe_skip_token (COMMA); token = parser.peek_current_token (); } }