Skip to content

Commit 38737ff

Browse files
committed
Reset RubyContext#preInitializing in patch()
1 parent c39aadc commit 38737ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/truffleruby/RubyContext.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ public void initialize() {
260260
} else {
261261
initialized = true;
262262
}
263-
264-
this.preInitializing = false;
265263
}
266264

267265
/** Re-initialize parts of the RubyContext depending on the running process. This is a small subset of the full
@@ -270,6 +268,10 @@ public void initialize() {
270268
protected boolean patch(Env newEnv) {
271269
this.env = newEnv;
272270
this.hasOtherPublicLanguages = computeHasOtherPublicLanguages(newEnv);
271+
this.preInitializing = newEnv.isPreInitialization();
272+
if (preInitializing) {
273+
throw CompilerDirectives.shouldNotReachHere("Expected patch Env#isPreInitialization() to be false");
274+
}
273275

274276
final Options oldOptions = this.options;
275277
final Options newOptions = createOptions(newEnv, language.options);

0 commit comments

Comments
 (0)