summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-18 17:44:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-18 17:44:09 +0000
commit126bd2014139a951e0c989243fe4b0de27c89978 (patch)
tree9ce74e6b744329404ecbb0f2496f48901b1a177e /compile.c
parent9cef6acdc7c377d30dbfa6fa9f56b1097b2ba998 (diff)
* compile.c (iseq_compile_each): alias and undef accept dsyms as well
as literals. [ruby-dev:32308] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/compile.c b/compile.c
index 141e55e156..91c94276c7 100644
--- a/compile.c
+++ b/compile.c
@@ -4067,10 +4067,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
case NODE_ALIAS:{
VALUE s1, s2;
+ enum node_type t;
- if (nd_type(node->u1.node) != NODE_LIT ||
- nd_type(node->u2.node) != NODE_LIT) {
- rb_bug("alias args must be NODE_LIT");
+ if (((t = nd_type(node->u1.node)) != NODE_LIT && t != NODE_DSYM) ||
+ ((t = nd_type(node->u2.node)) != NODE_LIT && t != NODE_DSYM)) {
+ rb_compile_bug(ERROR_ARGS "alias args must be NODE_LIT or NODE_DSYM");
}
s1 = node->u1.node->nd_lit;
s2 = node->u2.node->nd_lit;
@@ -4091,8 +4092,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_UNDEF:{
- if (nd_type(node->u2.node) != NODE_LIT) {
- rb_bug("undef args must be NODE_LIT");
+ enum node_type t = nd_type(node->u2.node);
+ if (t != NODE_LIT && t != NODE_DSYM) {
+ rb_compile_bug(ERROR_ARGS "undef args must be NODE_LIT");
}
ADD_INSN1(ret, nd_line(node), undef,
ID2SYM(rb_to_id(node->u2.node->nd_lit)));