Skip to content

Commit 4926e24

Browse files
authored
Merge pull request #6690 from eeckstein/fix-rle
2 parents 9392ac5 + f80f31d commit 4926e24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SILOptimizer/Utils/LoadStoreOptUtils.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ LSValue::reduceInner(LSLocation &Base, SILModule *M, LSLocationValueMap &Values,
5858

5959
// This is NOT a leaf node, we need to construct a value for it.
6060
auto Iter = NextLevel.begin();
61-
LSValue &FirstVal = Values[*Iter];
61+
62+
// Don't make this a reference! It may be invalidated as soon as the Values
63+
// map is modified, e.g. later at Values[Base] = ...
64+
LSValue FirstVal = Values[*Iter];
6265

6366
// There is only 1 children node and its value's projection path is not
6467
// empty, keep stripping it.

0 commit comments

Comments
 (0)