summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2015-03-17 16:50:59 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2015-03-17 16:50:59 +0000
commitd58230b9dcb3b312a2da8f874daa0cc8dc27da9b (patch)
treea31970bf83bca01a70838f4de5be528bae43f6b2 /compiler-rt/lib/interception
parent0b16859805c35c0173f67b2b58243184e073c7a0 (diff)
downloadbcm5719-llvm-d58230b9dcb3b312a2da8f874daa0cc8dc27da9b.tar.gz
bcm5719-llvm-d58230b9dcb3b312a2da8f874daa0cc8dc27da9b.zip
[ASan/Win] Fix a CHECK failure when an exception is thrown from a callback passed to BindIoCompletionCallback
This also simplifies how we handle QueueUserWorkItem llvm-svn: 232499
Diffstat (limited to 'compiler-rt/lib/interception')
-rw-r--r--compiler-rt/lib/interception/interception_win.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler-rt/lib/interception/interception_win.cc b/compiler-rt/lib/interception/interception_win.cc
index cd241c3d23c..19cf184948b 100644
--- a/compiler-rt/lib/interception/interception_win.cc
+++ b/compiler-rt/lib/interception/interception_win.cc
@@ -84,6 +84,7 @@ static size_t RoundUpToInstrBoundary(size_t size, char *code) {
cursor += 2;
continue;
case '\xE9': // E9 XX YY ZZ WW = jmp WWZZYYXX
+ case '\xB8': // B8 XX YY ZZ WW = mov eax, WWZZYYXX
cursor += 5;
continue;
}
@@ -182,10 +183,14 @@ bool OverrideFunction(uptr old_func, uptr new_func, uptr *orig_old_func) {
}
static const void **InterestingDLLsAvailable() {
- const char *InterestingDLLs[] = {"kernel32.dll",
- "msvcr110.dll", // VS2012
- "msvcr120.dll", // VS2013
- NULL};
+ const char *InterestingDLLs[] = {
+ "kernel32.dll",
+ "msvcr110.dll", // VS2012
+ "msvcr120.dll", // VS2013
+ // NTDLL should go last as it exports some functions that we should override
+ // in the CRT [presumably only used internally].
+ "ntdll.dll", NULL
+ };
static void *result[ARRAY_SIZE(InterestingDLLs)] = { 0 };
if (!result[0]) {
for (size_t i = 0, j = 0; InterestingDLLs[i]; ++i) {
OpenPOWER on IntegriCloud