Skip to content

Commit e60884c

Browse files
elvinw-inteligcbot
authored andcommitted
Add fix patch to avoid out-of-order evaluation in DebugInfo
Seperate recursive doRemap and operator [] into 2 lines to avoid out-of-order evaluations since both of them can access the same memory location in map Replacements. The patch is just seperating oneline into two.
1 parent 6aed43f commit e60884c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*========================== begin_copyright_notice ============================
2+
3+
Copyright (C) 2025 Intel Corporation
4+
5+
SPDX-License-Identifier: MIT
6+
7+
============================= end_copyright_notice ===========================*/
8+
9+
# Description : Fix ambiguous evaluation order
10+
11+
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
12+
index fd4b4170c..a667c6a89 100644
13+
--- a/llvm/lib/IR/DebugInfo.cpp
14+
+++ b/llvm/lib/IR/DebugInfo.cpp
15+
@@ -664,7 +664,12 @@ private:
16+
17+
return getReplacementMDNode(N);
18+
};
19+
- Replacements[N] = doRemap(N);
20+
+
21+
+ // Seperate recursive doRemap and operator [] into 2 lines to avoid
22+
+ // out-of-order evaluations since both of them can access the same memory
23+
+ // location in map Replacements.
24+
+ auto Value = doRemap(N);
25+
+ Replacements[N] = Value;
26+
}
27+
28+
/// Do the remapping traversal.

0 commit comments

Comments
 (0)