diff options
author | eileencodes <eileencodes@gmail.com> | 2021-07-20 13:53:22 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-07-21 10:06:33 -0700 |
commit | b940a453572b5c3ed5c0951647929e14f5843a7d (patch) | |
tree | 41d75724ad08b32809de0f7723b31d34f7d13cd6 /parse.y | |
parent | fa308a683d507996ee68352753bbb1813dceff31 (diff) |
Fix interpolated heredoc
This fixes https://bugs.ruby-lang.org/issues/18038. The provided
reproduction showed that this happens in heredocs with double
interpolation. In this case `DSTR` was getting returned but needs to be
convered to a `EVSTR` which is what is returned by the function. There
may be an additional bug here that we weren't able to produce. It seems
odd that `STR` returns `DSTR` while everything else should return
`EVSTR` since the function is `new_evstr`.
[Bug #18038][ruby-core:104597]
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4664
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -10181,7 +10181,10 @@ new_evstr(struct parser_params *p, NODE *node, const YYLTYPE *loc) switch (nd_type(node)) { case NODE_STR: nd_set_type(node, NODE_DSTR); - case NODE_DSTR: case NODE_EVSTR: + return node; + case NODE_DSTR: + break; + case NODE_EVSTR: return node; } } |