diff options
| author | Derek Bruening <bruening@google.com> | 2016-06-03 19:40:08 +0000 |
|---|---|---|
| committer | Derek Bruening <bruening@google.com> | 2016-06-03 19:40:08 +0000 |
| commit | 328e899301ed187ed7490e7443c897049b0e4200 (patch) | |
| tree | 0d13b9e1785b0f30bd488e07ca3dd5b268d35527 /compiler-rt/lib/esan/esan_interface.cpp | |
| parent | 737c136176bbfb6e42968da4f623a7e3d6ca12b3 (diff) | |
| download | bcm5719-llvm-328e899301ed187ed7490e7443c897049b0e4200.tar.gz bcm5719-llvm-328e899301ed187ed7490e7443c897049b0e4200.zip | |
[esan] Specify which tool via a global variable
Summary:
Adds a global variable to specify the tool, to support handling early
interceptors that invoke instrumented code, thus requiring shadow memory to
be initialized prior to __esan_init() being invoked.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka
Differential Revision: http://reviews.llvm.org/D20974
llvm-svn: 271714
Diffstat (limited to 'compiler-rt/lib/esan/esan_interface.cpp')
| -rw-r--r-- | compiler-rt/lib/esan/esan_interface.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/lib/esan/esan_interface.cpp b/compiler-rt/lib/esan/esan_interface.cpp index 5b10f7f2e82..f6ad3caa841 100644 --- a/compiler-rt/lib/esan/esan_interface.cpp +++ b/compiler-rt/lib/esan/esan_interface.cpp @@ -18,7 +18,10 @@ using namespace __esan; // NOLINT void __esan_init(ToolType Tool, void *Ptr) { - WhichTool = Tool; + if (Tool != __esan_which_tool) { + Printf("ERROR: tool mismatch: %d vs %d\n", Tool, __esan_which_tool); + Die(); + } initializeLibrary(Tool); processCompilationUnitInit(Ptr); } |

