Last active
February 26, 2023 13:05
-
-
Save scottt/d48eb2ae14e271a49de6 to your computer and use it in GitHub Desktop.
Generate SIGFPE through integer division by zero
This file contains 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
volatile int a, b, out; | |
__attribute__((noclone,noinline)) | |
void g(void) | |
{ | |
a = -1; | |
b = 0; | |
out = a/b; | |
} | |
__attribute__((noclone,noinline)) | |
void f(void) | |
{ | |
g(); | |
} | |
int main() | |
{ | |
f(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment