Skip to content

json_last_error_msg - better message - error position near by #18866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
some cleanup
  • Loading branch information
juan-morales committed Jun 16, 2025
commit a0764f309a749776f603d74114feb7abeb3f482f
8 changes: 1 addition & 7 deletions ext/json/json_scanner.re
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void php_json_scanner_init(php_json_scanner *s, const char *str, size_t str_len,
s->utf8_invalid = 0;
s->utf8_invalid_count = 0;
s->str_start = (php_json_ctype *)str; /* Initialize str_start */
s->input_start = (php_json_ctype *)str; /* Initialize str_start */
s->input_start = (php_json_ctype *)str; /* Initialize input_start */

s->cursor = (php_json_ctype *) str;
s->limit = (php_json_ctype *) str + str_len;
Expand All @@ -121,12 +121,6 @@ int php_json_scan(php_json_scanner *s)
std:
s->token = s->cursor;

/*if (s->cursor >= s->limit) {
s->errcode = PHP_JSON_ERROR_SYNTAX;
s->errpos = (size_t)(s->str_start - s->input_start);
return PHP_JSON_T_ERROR;
}*/

/*!re2c
re2c:indent:top = 1;
re2c:yyfill:enable = 0;
Expand Down