diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-21 22:42:00 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-10-04 22:51:47 -0600 |
commit | ef789dc484a35159ad825c98c4a2502f2097aed7 (patch) | |
tree | 110ef132487f5936ecef82c3f5dc3634fc4b7335 /gdb/python/py-frame.c | |
parent | 3fba72f7612c071f07fc7e65887bd1e8e056e272 (diff) | |
download | binutils-ef789dc484a35159ad825c98c4a2502f2097aed7.zip binutils-ef789dc484a35159ad825c98c4a2502f2097aed7.tar.gz binutils-ef789dc484a35159ad825c98c4a2502f2097aed7.tar.bz2 |
Fix latent bug in msp430-tdep.c
-Wshadow=local found this latent bug. msp430-tdep.c does:
const gdb_byte *arg_bits;
{
/* Aggregates of any size are passed by reference. */
gdb_byte struct_addr[4];
[...
arg_bits = struct_addr;
}
... use arg_bits
Here, arg_bits can point to an object that's gone out of scope.
The fix is to hoist the inner "struct_addr" buffer to an outer scope,
and rename it to avoid shadowing.
gdb/ChangeLog
2018-10-04 Tom Tromey <tom@tromey.com>
* msp430-tdep.c (msp430_push_dummy_call): Rename inner
"structs_addr" and hoist declaration.
Diffstat (limited to 'gdb/python/py-frame.c')
0 files changed, 0 insertions, 0 deletions