aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 17:29:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 17:29:04 +0000
commit9a8254ccecf9d3886cdc728068d27401ba9846ee (patch)
tree2ad79a34739445d02812dbeac61731df4f6c565d /compile.c
parentdb855960c4c591c74110ab52e5c096bf62ef5db1 (diff)
downloadruby-9a8254ccecf9d3886cdc728068d27401ba9846ee.tar.gz
compile.c: dstr head type
* compile.c (compile_dstr_fragments): head of dstr must be a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 9c59b595d7..69abb591ce 100644
--- a/compile.c
+++ b/compile.c
@@ -2341,8 +2341,11 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *node, int *cntp)
debugp_param("nd_lit", lit);
if (!NIL_P(lit)) {
cnt++;
- if (RB_TYPE_P(lit, T_STRING))
- lit = node->nd_lit = rb_fstring(node->nd_lit);
+ if (!RB_TYPE_P(lit, T_STRING)) {
+ rb_compile_bug(ERROR_ARGS "dstr: must be string: %s",
+ rb_builtin_type_name(TYPE(lit)));
+ }
+ lit = node->nd_lit = rb_fstring(lit);
ADD_INSN1(ret, nd_line(node), putobject, lit);
if (RSTRING_LEN(lit) == 0) first_lit = LAST_ELEMENT(ret);
}