codegen: replace final bad alloca with malloc (array)