]> git.ipfire.org Git - thirdparty/gcc.git/commit
ctf: Fix struct size truncation in 32-bit hosts [PR121903,PR121411]
authorDavid Faust <david.faust@oracle.com>
Mon, 15 Sep 2025 22:03:31 +0000 (15:03 -0700)
committerDavid Faust <david.faust@oracle.com>
Mon, 15 Sep 2025 22:14:59 +0000 (15:14 -0700)
commitbace01eeab69cabd0a326174909ced554af85c79
tree1c50c1caabc0da9a6c9c3d090f0d175044a3041e
parente97969e20b39f33bc3644ae8a16bd5ef1e9ef2d3
ctf: Fix struct size truncation in 32-bit hosts [PR121903,PR121411]

The 'size' argument of ctf_add_sou was size_t.  After the prior fixes
for PR121411, this could cause the struct size to be truncated when
encoding extremely large structs on a host where size_t is smaller than
unsigned HOST_WIDE_INT, manifesting for example as the test failure
reported in PR121903.  Change the argument to uHWI to resolve the issue.

PR debug/121411
PR debug/121903

gcc/

* ctfc.h (ctf_add_sou): Change size arg from size_t to uHWI.
* ctfc.cc (ctf_add_sou): Likewise.
gcc/ctfc.cc
gcc/ctfc.h