aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-12-27 17:42:41 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-12-28 22:17:04 +0100
commit813fb036ba9015c6744c85bf7c2e13ca1f4afff8 (patch)
tree7d3b5519094c272ab9bec327707532e2b8b90a5d /validation/optim
parent69a789a78d4e64052628307f25310e195a50f5ee (diff)
downloadsparse-dev-813fb036ba9015c6744c85bf7c2e13ca1f4afff8.tar.gz
fix implicit size of unsized arrays
When an array is declared without an explicit size. In this case, an implicit size is given by the number of elements in its initializer if one is present. Currently, in sparse, this implicit size is only associated with the node corresponding to the initializer while the base type is left unsized. This is a problem because the node is only used for the modifiers & address-space and the bitsize of nodes are expected to match the size of the basetype. So this implicit size can be used for when directly using the bit_size of the node but the array is still left, essentially unsized. It's not enough to simply copy the bitsize of the node to the base type because: 1) sym->array_size need to be set in the node & the base type. 2) the base type can be shared between several declarators. It's thus needed to copy the the base type to unshare it before setting the sym->array_size. Reported-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
0 files changed, 0 insertions, 0 deletions