This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 2.95.2 problem: alloca done within argument list evaluation, corrupts the rest of the argument list
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: gcc 2.95.2 problem: alloca done within argument list evaluation, corrupts the rest of the argument list
- From: Etienne LORRAIN <etienne_lorrain at yahoo dot fr>
- Date: Wed, 12 Jan 2000 14:45:42 +0100 (CET)
- Reply-To: etienne dot lorrain at ibm dot net
> The following construct is used by the attached test program (PASS/FAIL):
>
> f (yyy((t1 = alloca(ALLOCA_SIZE),xxx(t1))), 2);
>
> the second argument to f (the integer 2) is corrupted (the test program
> outputs FAIL in this case).
undefined behavior: t1 is used and changed without resynchronisation
point in between.
Because in C, parameters are pushed from right to left,
t1 is used before been alloca'ed, and the memory pointed to
(by initial value of t1) is corrupted.
Hope that helps,
Etienne.
___________________________________________________________
Do You Yahoo!?
Achetez, vendez! À votre prix! Sur http://encheres.yahoo.fr