[PATCH] Fix up trans_array_constructor UB (PR fortran/67496)

2016-08-17 Thread Jakub Jelinek
Hi! The bug here is that it dereferences expr->ts.u.cl if non-NULL unconditionally, no matter what expr->ts.type is. But, ts.u is an union, where ts.u.cl is only valid for BT_CHARACTER, ts.u.derived for BT_DERIVED etc. ts.u.pad (an int rather than pointer) for BT_HOLLERITH? and unused in others. S

Re: [PATCH] Fix up trans_array_constructor UB (PR fortran/67496)

2016-08-17 Thread Mikael Morin
Le 17/08/2016 à 20:56, Jakub Jelinek a écrit : Hi! The bug here is that it dereferences expr->ts.u.cl if non-NULL unconditionally, no matter what expr->ts.type is. But, ts.u is an union, where ts.u.cl is only valid for BT_CHARACTER, ts.u.derived for BT_DERIVED etc. ts.u.pad (an int rather than p