Created
July 18, 2009 19:28
-
-
Save manuel/149671 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // lambda trampoline. crashes with gcc -O2 and -O3. | |
| #include <stddef.h> | |
| #include <stdio.h> | |
| void | |
| foo(char *s) | |
| { | |
| __asm("foo_label:"); | |
| printf("%s\n", s); | |
| } | |
| void | |
| foo_trampoline(char *s) | |
| { | |
| __asm("jmp foo_label"); | |
| } | |
| int | |
| main() | |
| { | |
| foo_trampoline("hey"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment