Skip to content

Commit 39882bd

Browse files
committed
Fix infinite loop on inline assembly clobbers
Fix #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 <[email protected]>
1 parent 3de6255 commit 39882bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gcc/rust/expand/rust-macro-builtins-asm.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,11 @@ parse_llvm_clobbers (LlvmAsmContext &ctx)
11251125
{
11261126
ctx.llvm_asm.get_clobbers ().push_back (
11271127
{strip_double_quotes (token->as_string ()), token->get_locus ()});
1128+
1129+
parser.skip_token (STRING_LITERAL);
11281130
}
1129-
parser.skip_token (STRING_LITERAL);
1131+
1132+
parser.maybe_skip_token (COMMA);
11301133
token = parser.peek_current_token ();
11311134
}
11321135
}

0 commit comments

Comments
 (0)