]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Avoid alloca in target attribute parsing
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 12 Jul 2024 09:30:22 +0000 (10:30 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 12 Jul 2024 09:30:22 +0000 (10:30 +0100)
commit7bcef7532b10040bb82567136a208d0c4560767d
tree981f8d85f746942372b8f8b33c9331b0bcec902d
parent26dfb3f2d30f6d49ed126add9d123dcc6566385f
aarch64: Avoid alloca in target attribute parsing

The handling of the target attribute used alloca to allocate
a copy of unverified user input, which could exhaust the stack
if the input is too long.  This patch converts it to auto_vecs
instead.

I wondered about converting it to use std::string, which we
already use elsewhere, but that would be more invasive and
controversial.

gcc/
* config/aarch64/aarch64.cc (aarch64_process_one_target_attr)
(aarch64_process_target_attr): Avoid alloca.
gcc/config/aarch64/aarch64.cc