[ruby-core:112751] [Ruby master Bug#19439] Marshal.load doesn't load Regexp instance variables
From:
"naruse (Yui NARUSE) via ruby-core" <ruby-core@...>
Date:
2023-03-09 00:32:55 UTC
List:
ruby-core #112751
Issue #19439 has been updated by naruse (Yui NARUSE).
Backport changed from 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED to 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: DONE
ruby_3_2 4e4a4e42b284d9309a7e51c97058093539e7a843 merged revision(s) d2520b7b76759118071a16e6bca22726a5de9fb4.
----------------------------------------
Bug #19439: Marshal.load doesn't load Regexp instance variables
https://bugs.ruby-lang.org/issues/19439#change-102244
* Author: andrykonchin (Andrew Konchin)
* Status: Closed
* Priority: Normal
* ruby -v: 3.1.3
* Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: DONE
----------------------------------------
Hello, I've noticed this strange behaviour:
```ruby
source_object = Regexp.new("a")
source_object.instance_variable_set(:@foo, :bar)
regexp = Marshal.load(Marshal.dump(source_object))
regexp.instance_variables # => []
```
I would expect instance variables to be loaded
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/