spin2cpp
spin2cpp copied to clipboard
alloca() inside expressions does not work if parameters are on the stack
The current implementation of __builtin_alloca() pretty much depends on being able to manipulate the stack at will, but this assumption is false if parameters are being passed on the stack (as they are in the bytecode backend, and also in varargs functions).
Just to clarify: this becomes an issue if the __builtin_alloca() is itself inside an expression being passed as a parameter. In general __builtin_alloca() should work even inside functions that use stack based variables, because we do have a frame pointer.