Skip to content

Commit 9b12e06

Browse files
authored
Fix potential Out-of-order Evaluation in DebugInfo
In DebugTypeInfoRemoval, DenseMap Replacements's assignment's rvalue is a recursive function that may access Replacements itself. Since C++17 such an "right to left" order cannot get guaranteed. This change is to separate 1 line into 2.
1 parent ac1ba1f commit 9b12e06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/IR/DebugInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ class DebugTypeInfoRemoval {
798798

799799
return getReplacementMDNode(N);
800800
};
801-
Replacements[N] = doRemap(N);
801+
auto value = doRemap(N);
802+
Replacements[N] = value;
802803
}
803804

804805
/// Do the remapping traversal.

0 commit comments

Comments
 (0)