projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1da329
)
[OpenMP] Check loc for NULL before dereferencing it
author
Bryan Chan
<bryan.chan@huawei.com>
Mon, 7 Jun 2021 14:37:24 +0000
(10:37 -0400)
committer
Bryan Chan
<bryan.chan@huawei.com>
Mon, 7 Jun 2021 14:45:48 +0000
(10:45 -0400)
The ident_t * argument in __kmp_get_monotonicity was being used without
a customary NULL check, causing the function to crash in a Debug build.
Release builds were not affected thanks to dead store elimination.
openmp/runtime/src/kmp_dispatch.cpp
patch
|
blob
|
history
diff --git
a/openmp/runtime/src/kmp_dispatch.cpp
b/openmp/runtime/src/kmp_dispatch.cpp
index
d8e935d
..
c2e60fc
100644
(file)
--- a/
openmp/runtime/src/kmp_dispatch.cpp
+++ b/
openmp/runtime/src/kmp_dispatch.cpp
@@
-77,7
+77,7
@@
static inline int __kmp_get_monotonicity(ident_t *loc, enum sched_type schedule,
// Let default be monotonic for executables
// compiled with OpenMP* 4.5 or less compilers
- if (loc->get_openmp_version() < 50)
+ if (loc
!= NULL && loc
->get_openmp_version() < 50)
monotonicity = SCHEDULE_MONOTONIC;
if (use_hier || __kmp_force_monotonic)