1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

zend_vm_gen: Fix line numbers for --with-lines (#19789)

The removal of empty lines and lines containing only semicolons moved the
offsets around. Remove just the standalone semicolons without removing entire
lines to keep both files in sync. This is also useful for IDE split view mode
even when not enabling `--with-lines`.
This commit is contained in:
Tim Düsterhus
2025-09-11 12:29:24 +02:00
committed by GitHub
parent 26eac7de17
commit 51033c2e8d
2 changed files with 2165 additions and 4 deletions

2164
Zend/zend_vm_execute.h generated

File diff suppressed because it is too large Load Diff

View File

@@ -919,10 +919,7 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2, $name, $extra_spec=null)
}
/* Remove unnecessary ';' */
$code = preg_replace('/^\s*;\s*$/m', '', $code);
/* Remove WS */
$code = preg_replace('/[ \t]+\n/m', "\n", $code);
$code = preg_replace('/^\s*;\s*$/m', "\n", $code);
out($f, $code);
}