[PATCH] D51788: [winasan] Reduce hotpatch prefix check to 8 bytes

David Major via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 20 07:30:12 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT342649: [winasan] Reduce hotpatch prefix check to 8 bytes (authored by dmajor, committed by ).

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D51788

Files:
  lib/interception/interception_win.cc


Index: lib/interception/interception_win.cc
===================================================================
--- lib/interception/interception_win.cc
+++ lib/interception/interception_win.cc
@@ -223,8 +223,8 @@
   return true;
 }
 
-static const u8 kHintNop9Bytes[] = {
-  0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
+static const u8 kHintNop8Bytes[] = {
+  0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
 template<class T>
@@ -239,8 +239,8 @@
 static bool FunctionHasPadding(uptr address, uptr size) {
   if (IsMemoryPadding(address - size, size))
     return true;
-  if (size <= sizeof(kHintNop9Bytes) &&
-      FunctionHasPrefix(address, kHintNop9Bytes))
+  if (size <= sizeof(kHintNop8Bytes) &&
+      FunctionHasPrefix(address, kHintNop8Bytes))
     return true;
   return false;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51788.166285.patch
Type: text/x-patch
Size: 807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180920/f5e83949/attachment.bin>


More information about the llvm-commits mailing list