summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-11 15:12:06 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-11 15:12:06 +0000
commitff5475bfa198c9f94ab9ac395f9a09f913326b6c (patch)
tree7b2e9ce0f8d008ddecf11de3cc6795267b4c0205
parent9fc4c79ff331888003d8dcb944ca4c9bf9800a42 (diff)
merge revision(s) 64745: [Backport #15118]
Use opt_{aref,aset} over opt_{aref,aset}_with * compile.c (iseq_compile_each0): Use `opt_aref`/`opt_aset` over `opt_aref_with`/`opt_aset_with` when frozen_string_literal: true, not to resurrect the index string on non-Hash receiver. [Fix GH-1957] From: chopraanmol1 <chopraanmol1@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@65002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--compile.c2
-rw-r--r--version.h6
2 files changed, 5 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index 6f4c7f87aa..c3d62845e4 100644
--- a/compile.c
+++ b/compile.c
@@ -6036,6 +6036,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 1 &&
nd_type(node->nd_args->nd_head) == NODE_STR &&
ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
+ !ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal &&
ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
VALUE str = freeze_literal(iseq, node->nd_args->nd_head->nd_lit);
CHECK(COMPILE(ret, "recv", node->nd_recv));
@@ -7033,6 +7034,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 2 &&
nd_type(node->nd_args->nd_head) == NODE_STR &&
ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
+ !ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal &&
ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
{
VALUE str = freeze_literal(iseq, node->nd_args->nd_head->nd_lit);
diff --git a/version.h b/version.h
index 1f6410e70f..bec190c090 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.5.2"
-#define RUBY_RELEASE_DATE "2018-10-11"
-#define RUBY_PATCHLEVEL 100
+#define RUBY_RELEASE_DATE "2018-10-12"
+#define RUBY_PATCHLEVEL 101
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 10
-#define RUBY_RELEASE_DAY 11
+#define RUBY_RELEASE_DAY 12
#include "ruby/version.h"