Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: src/IceASanInstrumentation.h

Issue 2108083002: Implemented aligning and poisoning global redzones (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Removed casts Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/szrt_asan.c ('k') | src/IceASanInstrumentation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceASanInstrumentation.h
diff --git a/src/IceASanInstrumentation.h b/src/IceASanInstrumentation.h
index de250d4fd038f8510e4db607a60f6e805ee9ff0e..4757f24a5480bc23e1dd64e00c85653e87dd04aa 100644
--- a/src/IceASanInstrumentation.h
+++ b/src/IceASanInstrumentation.h
@@ -23,6 +23,8 @@
#include "IceGlobalInits.h"
#include "IceInstrumentation.h"
+#include <condition_variable>
+
namespace Ice {
class ASanInstrumentation : public Instrumentation {
@@ -31,17 +33,15 @@ class ASanInstrumentation : public Instrumentation {
ASanInstrumentation &operator=(const ASanInstrumentation &) = delete;
public:
- ASanInstrumentation(GlobalContext *Ctx) : Instrumentation(Ctx), RzNum(0) {
+ ASanInstrumentation(GlobalContext *Ctx)
+ : Instrumentation(Ctx), RzNum(0),
+ GlobalsLock(GlobalsMutex, std::defer_lock) {
ICE_TLS_INIT_FIELD(LocalDtors);
}
void instrumentGlobals(VariableDeclarationList &Globals) override;
private:
std::string nextRzName();
- VariableDeclaration *createRz(VariableDeclarationList *List,
- VariableDeclaration *RzArray,
- SizeT &RzArraySize,
- VariableDeclaration *Global);
void instrumentFuncStart(LoweringContext &Context) override;
void instrumentCall(LoweringContext &Context, InstCall *Instr) override;
void instrumentRet(LoweringContext &Context, InstRet *Instr) override;
@@ -51,8 +51,12 @@ private:
void instrumentStart(Cfg *Func) override;
void finishFunc(Cfg *Func) override;
ICE_TLS_DECLARE_FIELD(std::vector<InstCall *> *, LocalDtors);
- bool DidInsertRedZones = false;
std::atomic<uint32_t> RzNum;
+ bool DidProcessGlobals = false;
+ SizeT RzGlobalsNum = 0;
+ std::mutex GlobalsMutex;
+ std::unique_lock<std::mutex> GlobalsLock;
+ std::condition_variable GlobalsDoneCV;
};
} // end of namespace Ice
« no previous file with comments | « runtime/szrt_asan.c ('k') | src/IceASanInstrumentation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698