This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc 2.95.2 problem: alloca done within argument list evaluation, corrupts the rest of the argument list


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]