aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/interception
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2023-04-26 09:42:29 +0200
committerMartin Liska <mliska@suse.cz>2023-04-26 15:51:56 +0200
commitd53b3d94aaf211ffb2159614f5aaaf03ceb861cc (patch)
tree4202fe134ccc618029a07e7d1913c608bd7fb77f /libsanitizer/interception
parenta8e1551bdb372aa3cfe754429b5efd6229ae5fdb (diff)
downloadgcc-d53b3d94aaf211ffb2159614f5aaaf03ceb861cc.zip
gcc-d53b3d94aaf211ffb2159614f5aaaf03ceb861cc.tar.gz
gcc-d53b3d94aaf211ffb2159614f5aaaf03ceb861cc.tar.bz2
libsanitizer: merge from upstream (3185e47b5a8444e9fd).
Diffstat (limited to 'libsanitizer/interception')
-rw-r--r--libsanitizer/interception/interception_type_test.cpp4
-rw-r--r--libsanitizer/interception/interception_win.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/libsanitizer/interception/interception_type_test.cpp b/libsanitizer/interception/interception_type_test.cpp
index 2a118fb..7c3de82 100644
--- a/libsanitizer/interception/interception_type_test.cpp
+++ b/libsanitizer/interception/interception_type_test.cpp
@@ -24,9 +24,9 @@ COMPILER_CHECK(sizeof(::SSIZE_T) == sizeof(ssize_t));
COMPILER_CHECK(sizeof(::PTRDIFF_T) == sizeof(ptrdiff_t));
COMPILER_CHECK(sizeof(::INTMAX_T) == sizeof(intmax_t));
-#if !SANITIZER_APPLE
+# if SANITIZER_GLIBC || SANITIZER_ANDROID
COMPILER_CHECK(sizeof(::OFF64_T) == sizeof(off64_t));
-#endif
+# endif
// The following are the cases when pread (and friends) is used instead of
// pread64. In those cases we need OFF_T to match off_t. We don't care about the
diff --git a/libsanitizer/interception/interception_win.cpp b/libsanitizer/interception/interception_win.cpp
index d0db981..faaa8ee 100644
--- a/libsanitizer/interception/interception_win.cpp
+++ b/libsanitizer/interception/interception_win.cpp
@@ -738,7 +738,7 @@ bool OverrideFunctionWithRedirectJump(
return false;
if (orig_old_func) {
- uptr relative_offset = *(u32*)(old_func + 1);
+ sptr relative_offset = *(s32 *)(old_func + 1);
uptr absolute_target = old_func + relative_offset + kJumpInstructionLength;
*orig_old_func = absolute_target;
}