Commit 84538f1
committed
Use prepared accessors to retrieve Data fields
Data types are initialized with a set of accessors for the
requested fields, which allows caching those accessors and
avoiding costly hash lookups for future accesses. Due to a bug in
how these accessors are initialized, parent and subclasses may
have a different view of how those fields are stored in the object.
Here, the cached accessors are iterated, but then not used to read
the field. This results in a second field being created for the
subclass, in a different order from definition time. Using the
original accessor here accesses the correct field.
Fixes jruby#9241.
Note that there's other problems with the data layout inside a Data
type and other fixes will be needed to clean up how these accessors
are allocated and shared with subclasses.1 parent 6ed4909 commit 84538f1
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
0 commit comments