Skip to content

Commit e88a888

Browse files
committed
Invalidate after replace() succeeds
* So we don't do extra invalidations, and it is not possible to get an entry that is not valid but not yet replaced in the map.
1 parent 488158c commit e88a888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/core/module/ModuleFields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,8 @@ private void newMethodVersion(String methodToInvalidate) {
788788
if (methodEntry == null) {
789789
return;
790790
} else {
791-
methodEntry.invalidate(rubyModule, methodToInvalidate);
792791
if (methods.replace(methodToInvalidate, methodEntry, methodEntry.withNewAssumption())) {
792+
methodEntry.invalidate(rubyModule, methodToInvalidate);
793793
return;
794794
}
795795
}

0 commit comments

Comments
 (0)