Effect of diffusion on susceptibility to cracking during solidification