Commit 3488eda
committed
Fix gc_verify_internal_consistency error for pattern_matching in ripper
`gc_verify_internal_consistency` reports "found internal inconsistency"
for "test_pattern_matching.rb".
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-docker/4501173
Ruby's parser manages objects by two different ways.
1. For parser
* markable node holds objects
* call `RB_OBJ_WRITTEN` with `p->ast` as parent
* `mark_ast_value` marks objects
2. For ripper
* unmarkable node, NODE_RIPPER/NODE_CDECL, holds objects
* call `rb_ast_add_mark_object`. This function calls `rb_hash_aset` then
`RB_OBJ_WRITTEN` is called with `mark_hash` as parent
* `mark_hash` marks objects
However in current pattern_matching implementation
* markable node holds objects
* call `rb_ast_add_mark_object`
This commit fix it to be #2.
This was inconsistency however always `mark_hash` is
made young by `rb_ast_add_mark_object` call then objects
are not collected.1 parent a8782c4 commit 3488eda
1 file changed
+14
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
| 833 | + | |
| 834 | + | |
833 | 835 | | |
834 | 836 | | |
835 | 837 | | |
| |||
842 | 844 | | |
843 | 845 | | |
844 | 846 | | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
845 | 856 | | |
846 | 857 | | |
847 | 858 | | |
| |||
1115 | 1126 | | |
1116 | 1127 | | |
1117 | 1128 | | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
| 1129 | + | |
1126 | 1130 | | |
1127 | 1131 | | |
1128 | 1132 | | |
| |||
1137 | 1141 | | |
1138 | 1142 | | |
1139 | 1143 | | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
| 1144 | + | |
1147 | 1145 | | |
1148 | 1146 | | |
1149 | 1147 | | |
| |||
1165 | 1163 | | |
1166 | 1164 | | |
1167 | 1165 | | |
1168 | | - | |
1169 | 1166 | | |
1170 | 1167 | | |
1171 | 1168 | | |
1172 | 1169 | | |
1173 | 1170 | | |
1174 | 1171 | | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
| 1172 | + | |
1180 | 1173 | | |
1181 | 1174 | | |
1182 | 1175 | | |
| |||
0 commit comments