Fix by-ref list assign LIST_W+MAKE_REF separation
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 2 Sep 2020 08:23:44 +0000 (10:23 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 2 Sep 2020 08:26:55 +0000 (10:26 +0200)
commit8b6b2bda093b26640d0d1d640e4566684df88011
tree948d1c838cecc200a1bdad3e9d04400706070476
parentaedc7b0fb4dc4a586b9921c46615999d815b9383
Fix by-ref list assign LIST_W+MAKE_REF separation

Shift the responsibility for emitting MAKE_REF to the list assignment
code, to make sure that LIST_W and MAKE_REF are directly adjacent,
and there are no opcodes in between that could modify the LIST_W
result.

Additionally, adjust the zend_wrong_string_offset() code to not
perform a loop over opcodes and assert that the next opcode is
a relevant one. The VM write-safety model requires this.

This is a followup to a07c1f56aac1c0f6c8334760009b678cbf9d6138
and the full fix for oss-fuzz #25352.
Zend/zend_compile.c
Zend/zend_execute.c