Skip to content

Commit

Permalink
Fix the variable to be checked
Browse files Browse the repository at this point in the history
It should check the result of `rb_parser_search_nonascii`.
  • Loading branch information
yui-knk committed Feb 10, 2024
1 parent 6cafbd3 commit fdd92c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.y
Expand Up @@ -2265,7 +2265,7 @@ rb_parser_coderange_scan(struct parser_params *p, const char *ptr, long len, rb_
if (enc == rb_ascii8bit_encoding()) {
/* enc is ASCII-8BIT. ASCII-8BIT string never be broken. */
ptr = rb_parser_search_nonascii(ptr, e);
return p ? RB_PARSER_ENC_CODERANGE_VALID : RB_PARSER_ENC_CODERANGE_7BIT;
return ptr ? RB_PARSER_ENC_CODERANGE_VALID : RB_PARSER_ENC_CODERANGE_7BIT;
}

/* parser string encoding is always asciicompat */
Expand Down

0 comments on commit fdd92c2

Please sign in to comment.