[PATCH] D149346: [compiler-rt][interception][win] Add error messages for some errors
Alvin Wong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 07:42:06 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a7a00bdc99f: [compiler-rt][interception][win] Add error messages for some errors (authored by alvinhochun).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149346/new/
https://reviews.llvm.org/D149346
Files:
compiler-rt/lib/interception/interception_win.cpp
Index: compiler-rt/lib/interception/interception_win.cpp
===================================================================
--- compiler-rt/lib/interception/interception_win.cpp
+++ compiler-rt/lib/interception/interception_win.cpp
@@ -270,8 +270,13 @@
}
static void WriteJumpInstruction(uptr from, uptr target) {
- if (!DistanceIsWithin2Gig(from + kJumpInstructionLength, target))
+ if (!DistanceIsWithin2Gig(from + kJumpInstructionLength, target)) {
+ ReportError(
+ "interception_win: cannot write jmp further than 2GB away, from %p to "
+ "%p.\n",
+ (void *)from, (void *)target);
InterceptionFailed();
+ }
ptrdiff_t offset = target - from - kJumpInstructionLength;
*(u8*)from = 0xE9;
*(u32*)(from + 1) = offset;
@@ -295,6 +300,10 @@
int offset = indirect_target - from - kIndirectJumpInstructionLength;
if (!DistanceIsWithin2Gig(from + kIndirectJumpInstructionLength,
indirect_target)) {
+ ReportError(
+ "interception_win: cannot write indirect jmp with target further than "
+ "2GB away, from %p to %p.\n",
+ (void *)from, (void *)indirect_target);
InterceptionFailed();
}
*(u16*)from = 0x25FF;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149346.519491.patch
Type: text/x-patch
Size: 1218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230504/fbc79185/attachment.bin>
More information about the llvm-commits
mailing list