4 ms·
Because throwing a trampoline on an executable stack is a hack and a glaring exploitation vector. http://lists.llvm.org/pipermail/cfe-dev/2015-September/045037
by favorited 8y ago
Because throwing a trampoline on an executable stack is a hack and a glaring exploitation vector.
http://lists.llvm.org/pipermail/cfe-dev/2015-September/045037.html http://lists.llvm.org/pipermail/cfe-dev/2015-September/04503...
- geocar 8y agoStraw man. GCC doesn't use a trampoline for the following code: long f1 (void) { long i = 0; void f2(void) { i++; } f2(); return i; } int main() { return f1(); } So maybe David Chisnall doesn't know what he's talking about? Or maybe he's talking about a specific use case further up the thread. I'm not going to speculate. But to edify on my "Blocks" are fucking stupid throwaway, in clang you can do this: long f1 (void) { __block long i = 0; void (^f2)(void) = ^{ i++; }; f2(); return i; } int main() { return f1(); } which is close enough I could almost paper over the syntax differences with macros, but clang produces unnecessary allocations(!) which are completely unacceptable for my targets and make clang unworkable for me -- even if I could stomach the dogshit assembly that clang produces during testing and continue to use gcc on the packaging server. Surely clang could simply disallow passing the address of the nested function, if it's trying to protect people from themselves?