From 1b4875dc286f0194f75be0c425161fd1d1a8594c Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Fri, 3 Nov 2023 16:38:47 -0500 Subject: [PATCH] Invalidate replaced variable in case it has been cached --- .../main/java/org/jruby/internal/runtime/GlobalVariables.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/org/jruby/internal/runtime/GlobalVariables.java b/core/src/main/java/org/jruby/internal/runtime/GlobalVariables.java index dfc5e24ac697..441e8784d26f 100644 --- a/core/src/main/java/org/jruby/internal/runtime/GlobalVariables.java +++ b/core/src/main/java/org/jruby/internal/runtime/GlobalVariables.java @@ -97,6 +97,7 @@ public void alias(String name, String oldName) { throw RaiseException.from(runtime, runtime.getRuntimeError(), "can't alias in tracer"); } + variable.invalidate(); globalVariables.put(name, oldVariable); }