https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64242

--- Comment #28 from dave.anglin at bell dot net ---
On 2019-06-14 10:13 a.m., wilco at gcc dot gnu.org wrote:
> Given there are many possible stack layouts, the easiest option would be to
> clear the input buffer so it will jump to a null pointer. Eg.
>
> __attribute ((noinline)) void
> broken_longjmp (void *p)
> {
>   void *buf[32];
>   __builtin_memcpy (buf, p, 5 * sizeof (void*));
>   __builtin_memset (p, 0, 5 * sizeof (void*));
>   /* Corrupts stack pointer...  */
>   __builtin_longjmp (buf, 1);
> }
Yes, the above fixes test.  I think I have a fix for the pa longjmp and
nonlocal_goto expanders.

Reply via email to