This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: Fix sizeof for dynamic types other than arrays
- From: Tom Tromey <tom at tromey dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org, Tom de Vries <tdevries at suse dot de>
- Date: Mon, 30 Jul 2018 07:39:50 -0600
- Subject: Re: [PATCH] gdb: Fix sizeof for dynamic types other than arrays
- References: <20180729224137.27121-1-andrew.burgess@embecosm.com>
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
Andrew> All dynamic types are treated as arrays in the 'sizeof' code path,
Andrew> which means that structures can incorrectly be treated as arrays.
Andrew> This can cause a failure in the gdb.base/vla-datatypes.exp test
Andrew> script.
I noticed this with -fsanitize=address just yesterday as well.
Andrew> * eval.c (evaluate_subexp_for_sizeof): Check for array type before
Andrew> checking array bounds are defined.
This is ok. Thank you.
Tom