-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
Environment Information
JRuby version string:
jruby 9.3.0.0-SNAPSHOT (2.6.5) 2021-04-28 a309a88614 OpenJDK 64-Bit Server VM 11.0.10+9 on 11.0.10+9 +jit [linux-x86_64]
Operating system:
Linux 5.11.15-200.fc33.x86_64
Expected Behavior
The following script should succeed:
require 'ostruct'
data = { foo: 'bar' }
::Marshal.load ::Marshal.dump ::OpenStruct.new dataActual Behavior
An exception is thrown:
NoMethodError: undefined method `key?' for nil:NilClass
new_ostruct_member! at /home/dallen/.rvm/rubies/jruby-head/lib/ruby/stdlib/ostruct.rb:226
marshal_load at /home/dallen/.rvm/rubies/jruby-head/lib/ruby/stdlib/ostruct.rb:216
each_key at org/jruby/RubyHash.java:1558
marshal_load at /home/dallen/.rvm/rubies/jruby-head/lib/ruby/stdlib/ostruct.rb:216
load at org/jruby/RubyMarshal.java:138
It appears that the @table instance variable is not initialized when marshal_load is called in jruby-head/lib/ruby/stdlib/ostruct.rb. As a result, the call @table.key? fails.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels