The attached Visual Studio 2005 project when compiled 64bit with stack checking enabled. Will report a stack corruption on return from the function. There is no code in the function, just a calling sequence.The corruption occurs if the lx and lz variables have memory allocated via alloca function.If allocated via malloc then there is no corruption report.