vla: enable sizeof operator for indirection
authorSanimir Agovic <sanimir.agovic@intel.com>
Sat, 12 Oct 2013 11:36:16 +0000 (12:36 +0100)
committerSanimir Agovic <sanimir.agovic@intel.com>
Fri, 11 Apr 2014 12:43:50 +0000 (13:43 +0100)
commit04b19544ef6a97b62b2cc4a3170b900e046ab185
tree5fd7230a68abe5ef3f36b1411997588b202bd322
parent26cb189f8b46dbe7b2d485525329a8919005ca8a
vla: enable sizeof operator for indirection

This patch enables the sizeof operator for indirections:

1| void foo (size_t n) {
2|   int vla[n];
3|   int *vla_ptr = &vla;
4| }

(gdb) p sizeof(*vla_ptr)

yields sizeof (size_t) * n.

* eval.c (evaluate_subexp_for_sizeof) <UNOP_IND>: Create an indirect
value and retrieve the dynamic type size.
gdb/ChangeLog
gdb/eval.c