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

Refactor newline handling in zend_scan_escape_string to use HANDLE_NEWLINE macro (#19112)

This commit is contained in:
Yudai Takada
2025-07-13 17:40:31 +09:00
committed by GitHub
parent a402edac1a
commit 6e22d4c096

View File

@@ -921,9 +921,7 @@ static zend_result zend_scan_escape_string(zval *zendlval, char *str, int len, c
ZVAL_EMPTY_STRING(zendlval);
} else {
zend_uchar c = (zend_uchar)*str;
if (c == '\n' || c == '\r') {
CG(zend_lineno)++;
}
HANDLE_NEWLINE(c);
ZVAL_INTERNED_STR(zendlval, ZSTR_CHAR(c));
}
goto skip_escape_conversion;
@@ -2512,9 +2510,7 @@ inline_char_handler:
ZVAL_EMPTY_STRING(zendlval);
} else {
zend_uchar c = (zend_uchar)*(yytext+bprefix+1);
if (c == '\n' || c == '\r') {
CG(zend_lineno)++;
}
HANDLE_NEWLINE(c);
ZVAL_INTERNED_STR(zendlval, ZSTR_CHAR(c));
}
goto skip_escape_conversion;