On Mon, May 07, 2007 at 12:31:00PM -0400, David A. Wheeler wrote: > Many C compilers implement alloca() by simply manipulating the stack pointer. > Indeed, grischka's patch does this (though only for x86-32 Windows). But in > tinycc's case, the obvious way to do this will fail horrifically in many > cases, because alloca() can be embedded inside an expression, like this: > a( b(4+c()), alloca(x*g()), h()+n()); > In this example, a naive alloca implementation would be in the middle of > computing this expression, with some intermediate values on the stack, and > the alloca() call would then screw up the stack DURING the expression > calculation... causing the whole expression to miscalculate.
Are you shure this can happen with tinycc? AFAIR all parameters are evaluated before gfunc_call is called to put them on the stack. So an embedded alloca can never generate holes in a parameter list. Daniel _______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
