spin2cpp icon indicating copy to clipboard operation
spin2cpp copied to clipboard

alloca() inside expressions does not work if parameters are on the stack

Open totalspectrum opened this issue 3 years ago • 1 comments

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).

totalspectrum avatar Jun 17 '21 16:06 totalspectrum

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.

totalspectrum avatar Nov 19 '22 15:11 totalspectrum