diff --git a/core/src/main/java/org/jruby/runtime/invokedynamic/GlobalSite.java b/core/src/main/java/org/jruby/runtime/invokedynamic/GlobalSite.java index b44bbf16819e..db84c093a64a 100644 --- a/core/src/main/java/org/jruby/runtime/invokedynamic/GlobalSite.java +++ b/core/src/main/java/org/jruby/runtime/invokedynamic/GlobalSite.java @@ -105,7 +105,7 @@ public IRubyObject getGlobalFallback(ThreadContext context) throws Throwable { return (IRubyObject)uncached.invokeWithArguments(context); } - Invalidator invalidator = variable.getInvalidator(); + SwitchPoint invalidator = (SwitchPoint) variable.getInvalidator().getData(); IRubyObject value = variable.getAccessor().getValue(); MethodHandle target = constant(IRubyObject.class, value); @@ -113,7 +113,7 @@ public IRubyObject getGlobalFallback(ThreadContext context) throws Throwable { MethodHandle fallback = lookup().findVirtual(GlobalSite.class, "getGlobalFallback", methodType(IRubyObject.class, ThreadContext.class)); fallback = fallback.bindTo(this); - target = ((SwitchPoint)invalidator.getData()).guardWithTest(target, fallback); + target = invalidator.guardWithTest(target, fallback); setTarget(target);