Skip to content

Commit

Permalink
fixup! Improve error message for 'Cannot pass parameter by reference'
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Aug 31, 2020
1 parent ce6b2ad commit f114414
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,10 @@ static int zend_jit_throw_cannot_pass_by_ref_stub(dasm_State **Dst)
| mov EX->call, RX
|1:
| mov RX, r0
|.if X64
| mov CARG1d, dword OP:r0->op2.num
|.else
| mov CARG1d, OP:r0->op2.num
| EXT_CALL zend_jit_cannot_pass_by_reference, r0
| cmp byte OP:RX->op1_type, IS_TMP_VAR
| jne >9
Expand Down Expand Up @@ -8908,7 +8911,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}

if (call_num_args <= func->op_array.num_args) {
if (!trace || (trace->op == ZEND_JIT_TRACE_END
if (!trace || (trace->op == ZEND_JIT_TRACE_END
&& trace->stop == ZEND_JIT_TRACE_STOP_INTERPRETER)) {
uint32_t num_args;

Expand Down Expand Up @@ -8957,7 +8960,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}
}
} else {
if (!trace || (trace->op == ZEND_JIT_TRACE_END
if (!trace || (trace->op == ZEND_JIT_TRACE_END
&& trace->stop == ZEND_JIT_TRACE_STOP_INTERPRETER)) {
if (func && zend_accel_in_shm(func->op_array.opcodes)) {
| LOAD_IP_ADDR (func->op_array.opcodes)
Expand Down
4 changes: 2 additions & 2 deletions ext/opcache/tests/optimize_func_calls.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ Array
(
[0] => A Object
(
[obj] =>
[obj] =>
)

)
Array
(
[0] =>
[0] =>
)
string(7) "changed"
Array
Expand Down

0 comments on commit f114414

Please sign in to comment.