diff options
author | Reid Kleckner <rnk@google.com> | 2016-03-22 00:52:47 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-03-22 00:52:47 +0000 |
commit | 23d0fde5355a8b76ca741e0aa3e138825ae83451 (patch) | |
tree | 6b2894fd2089b7885a4c88bb881b8ca0833fbc0e /compiler-rt/lib/interception/interception_win.cc | |
parent | f027e130d8b1383e4f7081208ba35d24edbd9a37 (diff) | |
download | bcm5719-llvm-23d0fde5355a8b76ca741e0aa3e138825ae83451.tar.gz bcm5719-llvm-23d0fde5355a8b76ca741e0aa3e138825ae83451.zip |
[asan] Intercept strdup on Windows
Some unit tests were failing because we didn't intercept strdup. It
turns out it works just fine on 2013 and 2015 with a small patch to the
interception logic.
llvm-svn: 264013
Diffstat (limited to 'compiler-rt/lib/interception/interception_win.cc')
-rw-r--r-- | compiler-rt/lib/interception/interception_win.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/lib/interception/interception_win.cc b/compiler-rt/lib/interception/interception_win.cc index fdecff26a48..bd435f16e4e 100644 --- a/compiler-rt/lib/interception/interception_win.cc +++ b/compiler-rt/lib/interception/interception_win.cc @@ -108,6 +108,9 @@ static size_t RoundUpToInstrBoundary(size_t size, char *code) { case 0x3D83: // 83 3D XX YY ZZ WW TT = cmp TT, WWZZYYXX cursor += 7; continue; + case 0x7D83: // 83 7D XX YY = cmp dword ptr [ebp+XXh], YY + cursor += 4; + continue; } switch (0x00FFFFFF & *(unsigned int*)(code + cursor)) { case 0x24448A: // 8A 44 24 XX = mov eal, dword ptr [esp+XXh] @@ -120,7 +123,7 @@ static size_t RoundUpToInstrBoundary(size_t size, char *code) { continue; } switch (*(unsigned int *)(code + cursor)) { - case 0X2444B60F: // 0F B6 44 24 XX = movzx eax, byte ptr [esp+XXh] + case 0x2444B60F: // 0F B6 44 24 XX = movzx eax, byte ptr [esp+XXh] cursor += 5; continue; } |