diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-02-10 20:10:21 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-02-10 20:10:21 +0000 |
commit | b41e62b713026d958ed5f7e86418217011f3676e (patch) | |
tree | b1908f7d4228192dd2b2bc0a1ec27f13a65f668d /openmp | |
parent | 7dc8af5306c16fc844a5d8d703e64285469ab240 (diff) | |
download | bcm5719-llvm-b41e62b713026d958ed5f7e86418217011f3676e.tar.gz bcm5719-llvm-b41e62b713026d958ed5f7e86418217011f3676e.zip |
Fixed memory corruption problem.
llvm-svn: 228736
Diffstat (limited to 'openmp')
-rw-r--r-- | openmp/runtime/src/kmp_affinity.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index b16b458d215..5786d302251 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -350,6 +350,10 @@ public: hierarchy_info() : depth(1), uninitialized(true) {} void init(AddrUnsPair *adr2os, int num_addrs) { + /* Added explicit initialization of the depth here to prevent usage of dirty value + observed when static library is re-initialized multiple times (e.g. when + non-OpenMP thread repeatedly launches/joins thread that uses OpenMP). */ + depth = 1; uninitialized = false; for (kmp_uint32 i=0; i<maxLevels; ++i) { // init numPerLevel[*] to 1 item per level numPerLevel[i] = 1; |