Skip to content

Commit 640e45a

Browse files
eregonaardvark179
authored andcommitted
Fix MakeSpecialVariableStorageNode to add the slot lazily
1 parent 7501b55 commit 640e45a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/truffleruby/language/threadlocal/MakeSpecialVariableStorageNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public class MakeSpecialVariableStorageNode extends RubyContextSourceNode {
2626

2727
@Override
2828
public Object execute(VirtualFrame frame) {
29-
if (frameAssumption == null) {
29+
if (frameAssumption == null || !frameAssumption.isValid()) {
3030
CompilerDirectives.transferToInterpreterAndInvalidate();
3131
final FrameDescriptor descriptor = frame.getFrameDescriptor();
3232
frameAssumption = descriptor.getVersion();
33-
storageSlot = descriptor.findOrAddFrameSlot(Layouts.SPECIAL_VARIABLES_STORAGE);
33+
storageSlot = descriptor.findFrameSlot(Layouts.SPECIAL_VARIABLES_STORAGE);
3434
}
3535

3636
if (storageSlot != null) {

0 commit comments

Comments
 (0)