Commit 37b4148
vm: restore $obj->$var dollar-prefix AST-delegation (fix 7742c3b)
7742c3b incorrectly removed the `name[0] == '$'` branches in
emitObjectVarRead and emitObjectFuncCall, claiming they were dead code.
They are NOT dead — the parser distinguishes two dynamic-property
forms:
$obj->{$x} parses to runObjectDynVar / runObjectDynFunc (curly braces)
$obj->$x parses to runObjectVar / runObjectFunc with the literal
dollar-prefixed token ("$x") as the name
The first form is intercepted by IsObjectDynVarReadNode /
IsObjectDynFuncNode earlier in the pipeline. The second form reaches
emitObjectVarRead / emitObjectFuncCall with a name like "$x" that
needs runtime variable lookup.
Restore both AST-delegation branches with the correct rationale in the
comments. Fixes regressions:
access_modifiers/access_modifiers_011.phpt
assign_obj_op_cache_slot.phpt
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 9fbccbf commit 37b4148
1 file changed
Lines changed: 38 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
111 | 123 | | |
112 | 124 | | |
113 | 125 | | |
| |||
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
149 | | - | |
150 | | - | |
151 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
152 | 183 | | |
153 | 184 | | |
154 | 185 | | |
| |||
0 commit comments