diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-07-29 22:14:33 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-07-30 19:51:53 +0100 |
commit | c8f2dc0dc967222673d71a0493958a587c53ae3c (patch) | |
tree | be92ac5554b78d8b4c189d5a1b862fd4dfe804df /include | |
parent | 629cfaf1b0fbb32a985607c774bd8e7870b9fa94 (diff) | |
download | binutils-c8f2dc0dc967222673d71a0493958a587c53ae3c.zip binutils-c8f2dc0dc967222673d71a0493958a587c53ae3c.tar.gz binutils-c8f2dc0dc967222673d71a0493958a587c53ae3c.tar.bz2 |
gdb: Fix sizeof for dynamic types other than arrays
In commit:
commit 37cc0caeca4c9a8552370040f4cfeaeceaa03369
Date: Wed Jul 18 13:38:35 2018 +0200
[gdb/exp] Interpret size of vla with unknown size as <optimized out>
All dynamic types are treated as arrays in the 'sizeof' code path,
which means that structures can incorrectly be treated as arrays.
This can cause a failure in the gdb.base/vla-datatypes.exp test
script.
This commit adds a check that we do have an array before checking the
array bounds, and I also check that the array index type is dynamic
too. This second check probably isn't strictly necessary, but
shouldn't hurt, a non-dynamic index type shouldn't have undefined high
bound.
gdb/ChangeLog:
* eval.c (evaluate_subexp_for_sizeof): Check for array type before
checking array bounds are defined.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions