[compiler-rt] b8424b4 - Revert "[hwasan] More realistic setjmp test."

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 22:16:35 PDT 2021


Author: Vitaly Buka
Date: 2021-07-12T22:16:25-07:00
New Revision: b8424b42a58ee4cf8ca423de39993ed97f98f0bc

URL: https://github.com/llvm/llvm-project/commit/b8424b42a58ee4cf8ca423de39993ed97f98f0bc
DIFF: https://github.com/llvm/llvm-project/commit/b8424b42a58ee4cf8ca423de39993ed97f98f0bc.diff

LOG: Revert "[hwasan] More realistic setjmp test."

Breaks https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux-qemu

This reverts commit 5511bfdb671505c1e7968ab8ef6032414bba3852.

Added: 
    

Modified: 
    compiler-rt/test/hwasan/TestCases/longjmp.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/hwasan/TestCases/longjmp.c b/compiler-rt/test/hwasan/TestCases/longjmp.c
index 86fff7a0a23a..700a1cbee329 100644
--- a/compiler-rt/test/hwasan/TestCases/longjmp.c
+++ b/compiler-rt/test/hwasan/TestCases/longjmp.c
@@ -3,34 +3,24 @@
 
 // REQUIRES: stable-runtime, pointer-tagging
 
-#include <setjmp.h>
 #include <stdlib.h>
 #include <assert.h>
 #include <sanitizer/hwasan_interface.h>
-#include <unistd.h>
-
-static int *volatile p;
 
 __attribute__((noinline))
-int f(jmp_buf buf) {
+int f(void *caller_frame) {
   int z = 0;
-  p = &z;
+  int *volatile p = &z;
   // Tag of local is never zero.
   assert(__hwasan_tag_pointer(p, 0) != p);
 #ifndef NEGATIVE
-  // This will destroy shadow of "z", the p[0] in main will crash.
-  longjmp(buf, 1);
+  // This will destroy shadow of "z", and the following load will crash.
+  __hwasan_handle_longjmp(caller_frame);
 #endif
   return p[0];
 }
 
 int main() {
-  jmp_buf buf;
-  if (setjmp(buf)) {
-    return p[0];
-  } else {
-    f(buf);
-  }
-  return 0;
-  // CHECK: READ of size 4 at {{.*}} tags: {{.*}}/00 (ptr/mem)
+  return f(__builtin_frame_address(0));
+  // CHECK: READ of size 8 at {{.*}} tags: {{.*}}/00 (ptr/mem)
 }


        


More information about the llvm-commits mailing list