Skip to content

Commit 9a6c4a4

Browse files
committed
Raise the correct error for frozen $LOADED_FEATURES with pre-initialization
* A simple test is `$LOADED_FEATURES.freeze; require "ostruct"`, part of MRI tests.
1 parent 0b639c0 commit 9a6c4a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/ruby/truffleruby/core/truffle/feature_loader.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ def self.with_synchronized_features
281281
# always called inside #with_synchronized_features
282282
def self.get_loaded_features_index
283283
unless @loaded_features_version == $LOADED_FEATURES.version
284+
raise '$LOADED_FEATURES is frozen; cannot append feature' if $LOADED_FEATURES.frozen?
284285
@loaded_features_index.clear
285286
$LOADED_FEATURES.map! do |val|
286287
val = StringValue(val)

0 commit comments

Comments
 (0)