[GEN] Correct SEGV caused by struct type generation