[compiler-rt] 3d928e1 - [TSan] Fix pointer/type-mismatch bug in test that has turned into a compile error

Julian Lettner via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 16:31:48 PDT 2022


Author: Julian Lettner
Date: 2022-08-26T16:29:30-07:00
New Revision: 3d928e1d28c602c4036f50b7565637e7badc4467

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

LOG: [TSan] Fix pointer/type-mismatch bug in test that has turned into a compile error

Fixes this test compile error:
```
<path>/compiler-rt/test/tsan/debug_alloc_stack.cpp:54:7: error: no matching function for call to '__tsan_get_alloc_stack'
      __tsan_get_alloc_stack(mem, trace, num_frames, &thread_id, &thread_os_id);
      ^~~~~~~~~~~~~~~~~~~~~~
<path>/compiler-rt/test/tsan/debug_alloc_stack.cpp:17:16: note: candidate function not viable: no known conversion from 'uint64_t **' (aka 'unsigned long long **') to 'uint64_t *' (aka 'unsigned long long *') for 5th argument; remove &
extern "C" int __tsan_get_alloc_stack(void *addr, void **trace, size_t size,
               ^
<path>/compiler-rt/test/tsan/debug_alloc_stack.cpp:61:46: warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t *' (aka 'unsigned long long *') [-Wformat]
  fprintf(stderr, "thread os id = 0x%llx\n", thread_os_id);
                                    ~~~~     ^~~~~~~~~~~~
1 warning and 1 error generated.
```

Added: 
    

Modified: 
    compiler-rt/test/tsan/debug_alloc_stack.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/tsan/debug_alloc_stack.cpp b/compiler-rt/test/tsan/debug_alloc_stack.cpp
index ffe99e73a2ab..5deed49b18b2 100644
--- a/compiler-rt/test/tsan/debug_alloc_stack.cpp
+++ b/compiler-rt/test/tsan/debug_alloc_stack.cpp
@@ -49,7 +49,7 @@ int main() {
   void *trace[100];
   size_t num_frames = 100;
   int thread_id;
-  uint64_t *thread_os_id;
+  uint64_t thread_os_id;
   num_frames =
       __tsan_get_alloc_stack(mem, trace, num_frames, &thread_id, &thread_os_id);
 


        


More information about the llvm-commits mailing list