-
Enhancement
-
Resolution: Implemented
-
Medium
-
Code Generation Tools
-
CODEGEN-7229
-
-
-
default
-
Add an explicit constructor which calls memset to set the large array to zero instead of relying on default initializations. This will prevent the compiler from creating the local temporary.
-
The attached C++ file uses a series of templates and structures to create an object which has a member with a large array. The generated code which constructs this object includes an auto-generated function with a very large local frame. Calling this function overflows the stack.
Use the attached files.
% cl6x -@options.txt main.cpp
Inspect the resulting main.asm file. Look for the auto-generated function named $P$F0. The local frame is 40,816 bytes. The function main passes the address of $P$F0 to an internal RTS function. When it finally executes, the stack is overflowed.
Please see the related forum thread for more context.