]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Remove some alloca uses
authorTom Tromey <tom@tromey.com>
Wed, 17 Apr 2024 22:17:33 +0000 (16:17 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 21 Apr 2024 18:12:43 +0000 (12:12 -0600)
commite6375bc8ebbbc177c79f08e9616eb0b131229f65
treefca4ad6a0389268a24e79e5b007b65528cda648d
parent7e9ef24e4a72d8d174932c7dd6be44226328ab88
Remove some alloca uses

A few spots (mostly in the parsers) use alloca to ensure that a string
is terminated before passing it to a printf-like function (mostly
'error').  However, this isn't needed as the "%.*s" format can be used
instead.

This patch makes this change.

In one spot the alloca is dead code and is simply removed.

Regression tested on x86-64 Fedora 38.

Approved-By: John Baldwin <jhb@FreeBSD.org>
gdb/c-exp.y
gdb/cp-name-parser.y
gdb/cp-support.c
gdb/d-exp.y
gdb/f-exp.y
gdb/go-exp.y
gdb/m2-exp.y
gdb/p-exp.y