Ticket #9 (new defect)
sizeof computation fails for nested derived types (pointer to array or array of pointers)
| Reported by: | guest | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | general | Version: | 0.15.1 |
| Keywords: | Cc: |
Description
c2hs reports the wrong size of nested derived types.
struct pointer_to_array {
int (*y)[4 ];
} PTA;
struct array_of_pointers {
int* y[4];
} AOP;
diff fail2_via_c.out fail2_via_c2hs.out 1,2c1,2 < __tydef__array_of_pointers__: 16 < __tydef__pointer_to_array__: 4 --- > __tydef__array_of_pointers__: 4 > __tydef__pointer_to_array__: 16
The reason for this is that the analysis code assumes that pointer to T is represented as CPointerDeclr TDeclr, but it is actually parsed as TDeclr (...(CPointerDeclr)...).
Change History
Note: See
TracTickets for help on using
tickets.
