aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-17 09:28:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-17 09:28:58 +0000
commitbeef21384ca6357a41e31b4ae96206e39c784af7 (patch)
tree16638d73ac6d58aad35629be0eb0c03aa6b3894d /vm_insnhelper.c
parent82839e18cc99457db60220b0c19a3f120258750e (diff)
downloadruby-beef21384ca6357a41e31b4ae96206e39c784af7.tar.gz
literal symbol by intern
* compile.c (iseq_compile_each0): literal symbol should not be affected by redefinition of String#intern method. * vm_insnhelper.c (rb_vm_str_intern): intern a string into a symbol directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 1678100eab..d11529ed75 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2794,6 +2794,13 @@ FUNC_FASTCALL(rb_vm_opt_struct_aset)(rb_thread_t *th, rb_control_frame_t *reg_cf
return reg_cfp;
}
+rb_control_frame_t *
+FUNC_FASTCALL(rb_vm_str_intern)(rb_thread_t *th, rb_control_frame_t *reg_cfp)
+{
+ TOPN(0) = rb_str_intern(TOPN(0));
+ return reg_cfp;
+}
+
/* defined insn */
static enum defined_type