Commit 04897a1
committed
Copy Data type's var table manager with new realClass
In order to allow Data types to specialize their fields completely,
we introduced a copy constructor for VariableTableManager that
duplicates the Data type's VTM into the new subclass. But because
that duplicate still used the same realClass, variable accessors
would frequently return to the original Data type's VTM rather than
use the duplicate.
This patch fixes the duplication process to also reset the
realClass to the new Data type subclass, keeping all future usages
and updates at the correct level. Without this, new instance
variables discovered on subtypes would add an accessor on the
subtype, but then proceed to allocate the variable table based on
the size of the table in the old VTM from the Data supertype.1 parent 0c09944 commit 04897a1
File tree
2 files changed
+10
-9
lines changed- core/src/main/java/org/jruby
- runtime/ivars
2 files changed
+10
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | | - | |
| 1076 | + | |
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| |||
1083 | 1083 | | |
1084 | 1084 | | |
1085 | 1085 | | |
1086 | | - | |
| 1086 | + | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
1090 | | - | |
| 1090 | + | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
| |||
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
544 | 545 | | |
545 | 546 | | |
546 | 547 | | |
547 | | - | |
548 | | - | |
| 548 | + | |
| 549 | + | |
549 | 550 | | |
550 | 551 | | |
551 | 552 | | |
| |||
0 commit comments