]> git.ipfire.org Git - thirdparty/gcc.git/commit
a68: fix uninitialized memory in get_hole_symbol [PR algol68/124115] master trunk
authorJose E. Marchesi <jemarch@gnu.org>
Mon, 16 Feb 2026 20:32:59 +0000 (21:32 +0100)
committerJose E. Marchesi <jemarch@gnu.org>
Mon, 16 Feb 2026 20:34:13 +0000 (21:34 +0100)
commita3fbf2c4bbec563df0cd9862c2987b1b7806801c
treefa031e0ddc28ea9de88df0f9d6855b1e05671fd3
parent716ec14c573c7ec9e3732e66c7288db8f0348154
a68: fix uninitialized memory in get_hole_symbol [PR algol68/124115]

The function get_hole_symbol is supposed to set *addrp to either true
or false.  However it was only setting it to false, causing
uninitialized memory.

This patch also removes a gcc_asser tfrom a68_make_formal_hole_decl.
If the formal hole results in an empty symbol then it may result into
invalid assembly being generated, but that is akin to use an invalid
asm template.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

PR algol68/124115
* a68-low-holes.cc (get_hole_symbol): Always set *addrp to avoid
uninitialized memory.
* a68-low.cc (a68_make_formal_hole_decl): Remove assert.

gcc/testsuite/ChangeLog

PR algol68/124115
* algol68/compile/formal-hole-2.a68: New test.
gcc/algol68/a68-low-holes.cc
gcc/algol68/a68-low.cc
gcc/testsuite/algol68/compile/formal-hole-2.a68 [new file with mode: 0644]