Commit 22aeec7
committed
Fix GH-18105: Wrong file & line on exception trace with trait default parameter
When a trait method has a default parameter using `new` and the constructor
throws, the exception's file/line pointed to the class using the trait rather
than where the throw actually occurred. `EG(filename_override)`, set to the
scope's filename during AST evaluation, leaked into the constructor's VM
re-entry.
Clear the override before constructor calls in `zend_ast_evaluate_inner`'s
ZEND_AST_NEW handler so normal stack frame resolution applies.
Closes GH-181051 parent 6d62d87 commit 22aeec7
2 files changed
+49
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1102 | 1106 | | |
1103 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
1104 | 1110 | | |
1105 | 1111 | | |
1106 | 1112 | | |
| |||
1120 | 1126 | | |
1121 | 1127 | | |
1122 | 1128 | | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1123 | 1133 | | |
1124 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
1125 | 1137 | | |
1126 | 1138 | | |
1127 | 1139 | | |
| |||
0 commit comments