properly handle arrays of typedefs and structs inside structs
commit0dea9c898e5d74c52914bc6929d89d4b5123fe84
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 2 Apr 2016 15:02:13 +0000 (2 17:02 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 4 Apr 2016 10:46:12 +0000 (4 12:46 +0200)
treec8a6b64ee13cdfa8605978e5938d31ea0623bb32
parentef311970af44c7ce2bc0c87dc303c4cbc4e358a7
properly handle arrays of typedefs and structs inside structs

add_type calls add_field_types in order to make sure that
types that are used inside the definition of some other type
are stored before that other type in the list of types.
This allows the user to print the type definitions in the order
in which the types are stored.
However, add_field_types would only consider fields
of a typedef or record type and not arrays of such types.
Consider such arrays as well.
The typedefs also need to be added to the list of types
first in PetScan::extract_array.  Otherwise, they would
not even be considered.

Reported-by: Bruno bodin <bbodin@inf.ed.ac.uk>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
clang.cc
clang.h
scan.cc
tests/call_struct.scop
tests/struct14.c [new file with mode: 0644]
tests/struct14.scop [new file with mode: 0644]