Comment by fluntcaps
2 days ago
You can do something like:
void *get_sp(void) {
volatile char c;
return (void *)&c;
}
Or, in GCC and Clang:
void *get_sp(void) {
return __builtin_frame_address(0);
}
Which gets you close enough.
No comments yet
Contribute on Hacker News ↗