Skip to content

Instantly share code, notes, and snippets.

@vault
Created February 12, 2013 17:58
Show Gist options
  • Save vault/4771792 to your computer and use it in GitHub Desktop.
Save vault/4771792 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void* justwait(int selector)
{
if (selector)
{
printf("%d\n", 1+1);
DEARGOD:
printf("%d\n", 2+2);
printf("%d\n", 3+3);
return NULL;
}
else
{
return &&DEARGOD;
}
}
void print4(void * WHYGODWHY)
{
goto *((void*)((long)WHYGODWHY - 4*sizeof(void*)));
}
int main()
{
void * oops = justwait(0);
print4(oops);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment