Skip to content

Commit b233ed7

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix phpGH-17836: zend_vm_gen.php shouldn't break on Windows line endings
2 parents 3dcf36c + 8d7cb8c commit b233ed7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Zend/zend_vm_gen.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,12 @@ function gen_vm($def, $skel) {
24162416
$max_opcode = 0;
24172417
$extra_num = 256;
24182418
foreach ($in as $line) {
2419+
// Handle Windows line endings, GH-17836; since a bunch of regular
2420+
// expressions below test for a newline at the end, just update the
2421+
// ending
2422+
if (substr($line, -2) === "\r\n") {
2423+
$line = substr_replace($line, "\n", -2);
2424+
}
24192425
++$lineno;
24202426
if (strpos($line,"ZEND_VM_HANDLER(") === 0 ||
24212427
strpos($line,"ZEND_VM_INLINE_HANDLER(") === 0 ||

0 commit comments

Comments
 (0)