Skip to content

Commit f68a071

Browse files
committed
Do not invalidate the GlobalVariableStorage Assumption if aliasing twice the same global variables
1 parent c61e294 commit f68a071

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/truffleruby/language/globals/GlobalVariables.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public void alias(String oldName, String newName) {
7272
final GlobalVariableStorage storage = getStorage(oldName);
7373

7474
final GlobalVariableStorage previousStorage = variables.put(newName, storage);
75-
if (previousStorage != null) {
75+
// If previousStorage == storage, we already have that alias and should not invalidate
76+
if (previousStorage != null && previousStorage != storage) {
7677
previousStorage.getValidAssumption().invalidate();
7778
}
7879
}

0 commit comments

Comments
 (0)