From 899fc0333f6ba2364c0b223843181fc91f3e5dd7 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 Oct 2015 08:06:58 +0000 Subject: id.def: internal IDs * defs/id.def: move internal IDs for frozen-string-literal-debug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ compile.c | 4 ++-- defs/id.def | 3 +++ error.c | 5 ++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b2d84f3b9..6694baa587 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 27 17:06:55 2015 Nobuyoshi Nakada + + * defs/id.def: move internal IDs for frozen-string-literal-debug. + Tue Oct 27 16:41:05 2015 Nobuyoshi Nakada * error.c (rb_error_frozen_object): use rb_attr_get instead of diff --git a/compile.c b/compile.c index a584e97b85..ba5f5be5ee 100644 --- a/compile.c +++ b/compile.c @@ -5116,8 +5116,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) } else { VALUE str = rb_str_dup(node->nd_lit); - rb_iv_set(str, "__object_created_path__", iseq->body->location.path); - rb_iv_set(str, "__object_created_line__", INT2FIX(line)); + rb_ivar_set(str, id_debug_created_path, iseq->body->location.path); + rb_ivar_set(str, id_debug_created_line, INT2FIX(line)); ADD_INSN1(ret, line, putobject, rb_obj_freeze(str)); } } diff --git a/defs/id.def b/defs/id.def index d4cd5e77de..b63d1289b4 100644 --- a/defs/id.def +++ b/defs/id.def @@ -60,6 +60,9 @@ firstline, predefined = __LINE__+1, %[\ core#hash_merge_ary core#hash_merge_ptr core#hash_merge_kwd + + debug#created_path + debug#created_line ] class KeywordError < RuntimeError diff --git a/error.c b/error.c index 4774ef6a94..9dac198ae1 100644 --- a/error.c +++ b/error.c @@ -2227,10 +2227,9 @@ void rb_error_frozen_object(VALUE frozen_obj) { VALUE path, line; - ID created_path, created_line; + const ID created_path = id_debug_created_path; + const ID created_line = id_debug_created_line; - CONST_ID(created_path, "__object_created_path__"); - CONST_ID(created_line, "__object_created_line__"); if (!NIL_P(path = rb_attr_get(frozen_obj, created_path)) && !NIL_P(line = rb_attr_get(frozen_obj, created_line))) { rb_raise(rb_eRuntimeError, "can't modify frozen %"PRIsVALUE", created at %"PRIsVALUE":%"PRIsVALUE, -- cgit v1.2.3