]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Prevent segfault on builtin metavars
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 18 Sep 2025 14:08:30 +0000 (16:08 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 20:30:52 +0000 (21:30 +0100)
commit42c46d96a37ac619e60d5ee7949a3248e387b6f6
treeba6ec6a80244a6dfe6cd620190724d81cd3400d5
parentc73e44a59cf2cff84d0996182e8423425723c9da
gccrs: Prevent segfault on builtin metavars

Builtin metavars are not in the fragment, the compiler should not emit
an error message.

gcc/rust/ChangeLog:

* expand/rust-macro-substitute-ctx.cc (is_builtin_metavariable): Add
function to check builtin metavars knowledge.
(SubstituteCtx::check_repetition_amount): Do not process missing
fragment.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/expand/rust-macro-substitute-ctx.cc