1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y (here_document): remove dead code

str is always zero when evaluating the branch.
Found by Coverity Scan.
This commit is contained in:
Yusuke Endoh 2019-07-15 14:07:22 +09:00
parent 5353401c25
commit 711dfec3fa

View file

@ -7306,10 +7306,7 @@ here_document(struct parser_params *p, rb_strterm_heredoc_t *here)
dispatch_scan_event(p, tSTRING_CONTENT);
}
else {
if (str) {
rb_str_append(p->delayed, str);
}
else if ((len = p->lex.pcur - p->lex.ptok) > 0) {
if ((len = p->lex.pcur - p->lex.ptok) > 0) {
if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) {
int cr = ENC_CODERANGE_UNKNOWN;
rb_str_coderange_scan_restartable(p->lex.ptok, p->lex.pcur, enc, &cr);