[PATCH] Protection against stack-based memory corruption errors using SafeStack

Volodymyr Kuznetsov vova.kuznetsov at epfl.ch
Tue May 19 22:09:43 PDT 2015


================
Comment at: lib/Transforms/Instrumentation/SafeStack.cpp:231
@@ +230,3 @@
+
+    UnsafeStackPtr = getOrCreateUnsafeStackPtr(M);
+
----------------
You can do a quick scan over all functions in a Module to check if any of them have Attribute::SafeStack, and only create the UnsafeStackPtr if it is the case. This way, the variable won't be created when -fsanitize=safe-stack is not used. You can also store the result of the scan in a class member variable and exit runOnFunction immediately when safestack is not needed.

http://reviews.llvm.org/D6094

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list