php-src/Zend/tests/jmpznz_relative_offsets.phpt
Nikita Popov 7d483418e2 Fix relative offsets when copying JMPZNZ
This was doing a plain copy of JMPZNZ, even though it encodes
offsets relative to the opline. As such, the offsets would be
relative to target, while they should be relative to opline.
Fix this by recomputing them.

Fixes oss-fuzz #39295.
2021-09-27 16:18:40 +02:00

17 lines
232 B
PHP

--TEST--
Check for correct treatment of relative JMPZNZ offsets when copying opline
--FILE--
<?php
function test($c) {
L1:
if ($c) {
goto L1;
goto L1;
}
}
test(false);
?>
===DONE===
--EXPECT--
===DONE===