[Openmp-commits] [openmp] 3fa2e19 - [OpenMP][Tool] Fix possible NULL-pointer dereference in test

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 11 11:15:52 PST 2020


Author: Joachim Protze
Date: 2020-11-11T20:13:22+01:00
New Revision: 3fa2e193384048daafe1fa74bf88253b4cf5ce6e

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

LOG: [OpenMP][Tool] Fix possible NULL-pointer dereference in test

Avoid dereferencing a possibly uninitialized pointer as mentioned in D91280.

Added: 
    

Modified: 
    openmp/tools/archer/tests/task/task_late_fulfill.c

Removed: 
    


################################################################################
diff  --git a/openmp/tools/archer/tests/task/task_late_fulfill.c b/openmp/tools/archer/tests/task/task_late_fulfill.c
index 92454f289154..d27409245e7e 100644
--- a/openmp/tools/archer/tests/task/task_late_fulfill.c
+++ b/openmp/tools/archer/tests/task/task_late_fulfill.c
@@ -34,7 +34,7 @@ int main() {
     usleep(10000);
     a++;
     printf("%i: calling omp_fulfill_event\n", omp_get_thread_num());
-    omp_fulfill_event(*f_event);
+    omp_fulfill_event(event);
 //#pragma omp task if (0) depend(in : f_event)
 //    {}
     b++;
@@ -47,14 +47,6 @@ int main() {
 // no race for a++ in line 32:
 // CHECK-NOT: #0 {{.*}}task_late_fulfill.c:35
 
-// we expect a race on f_event:
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK-NEXT:   {{(Write|Read)}} of size 8
-// CHECK-NEXT: #0 {{.*}}task_late_fulfill.c:37
-// CHECK:   Previous write of size 8
-// CHECK-NEXT: #0 {{.*}}task_late_fulfill.c:26
-
 // CHECK: WARNING: ThreadSanitizer: data race
 // CHECK-NEXT:   {{(Write|Read)}} of size 4
 // CHECK-NEXT: #0 {{.*}}task_late_fulfill.c:31


        


More information about the Openmp-commits mailing list