summaryrefslogtreecommitdiff
path: root/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
commit63c30682e4590f4771dd0adac64f41fa1f9cd3bc (patch)
treec2d3ba1010fc4669c04446dcd7f24f0e6bab0b71 /lib/interception
parent9c8af610aa852637031b4b316e8f37d9367d1973 (diff)
[ASan/Win] Fix a CHECK failure when an exception is thrown from a callback passed to BindIoCompletionCallback
This also simplifies how we handle QueueUserWorkItem git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@232499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception')
-rw-r--r--lib/interception/interception_win.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/interception/interception_win.cc b/lib/interception/interception_win.cc
index cd241c3d2..19cf18494 100644
--- a/lib/interception/interception_win.cc
+++ b/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) {