aboutsummaryrefslogtreecommitdiffstats
path: root/compile.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 /compile.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 'compile.c')
-rw-r--r--compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 7ba0604699..5cf7f750fc 100644
--- a/compile.c
+++ b/compile.c
@@ -29,6 +29,9 @@
#undef RUBY_UNTYPED_DATA_WARNING
#define RUBY_UNTYPED_DATA_WARNING 0
+rb_control_frame_t *
+ FUNC_FASTCALL(rb_vm_str_intern)(rb_thread_t *, rb_control_frame_t *);
+
#define ISEQ_TYPE_ONCE_GUARD ISEQ_TYPE_DEFINED_GUARD
#define FIXNUM_INC(n, i) ((n)+(INT2FIX(i)&~FIXNUM_FLAG))
@@ -6571,7 +6574,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
case NODE_DSYM:{
compile_dstr(iseq, ret, node);
if (!popped) {
- ADD_SEND(ret, line, idIntern, INT2FIX(0));
+ ADD_INSN1(ret, line, opt_call_c_function, rb_vm_str_intern);
}
else {
ADD_INSN(ret, line, pop);