Commit c3dff8a
committed
op.c: call class_wrap_method_body() for lexical methods
Class method bodies must be wrapped by this function, which adds the
OP_METHSTART op at the beginning, which is responsible for shifting
the `$self` lexical from the arguments array, and setting up field
bindings. This was already done for non-lexical (i.e. package) methods
but was forgotten for lexical methods, so they didn't work properly,
leading to the bug found in GH#23030 whereby the argument count in a
signatured lexical method did not take account of the `$self` argument
properly.
In addition, fields accessed by the method body would not have been
working, though originally this wasn't reported or tested either. A test
for this has also been added.1 parent 42e7ab1 commit c3dff8a
2 files changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10657 | 10657 | | |
10658 | 10658 | | |
10659 | 10659 | | |
| 10660 | + | |
| 10661 | + | |
10660 | 10662 | | |
10661 | 10663 | | |
10662 | 10664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
137 | 157 | | |
0 commit comments