* 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
This commit is contained in:
parent
9cef6acdc7
commit
126bd20141
@ -1,3 +1,8 @@
|
|||||||
|
Mon Nov 19 02:44:07 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* compile.c (iseq_compile_each): alias and undef accept dsyms as well
|
||||||
|
as literals. [ruby-dev:32308]
|
||||||
|
|
||||||
Mon Nov 19 02:31:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Nov 19 02:31:36 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* eval_method.ci (rb_add_method): no redefinition warning for undef.
|
* eval_method.ci (rb_add_method): no redefinition warning for undef.
|
||||||
|
12
compile.c
12
compile.c
@ -4067,10 +4067,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
|||||||
}
|
}
|
||||||
case NODE_ALIAS:{
|
case NODE_ALIAS:{
|
||||||
VALUE s1, s2;
|
VALUE s1, s2;
|
||||||
|
enum node_type t;
|
||||||
|
|
||||||
if (nd_type(node->u1.node) != NODE_LIT ||
|
if (((t = nd_type(node->u1.node)) != NODE_LIT && t != NODE_DSYM) ||
|
||||||
nd_type(node->u2.node) != NODE_LIT) {
|
((t = nd_type(node->u2.node)) != NODE_LIT && t != NODE_DSYM)) {
|
||||||
rb_bug("alias args must be NODE_LIT");
|
rb_compile_bug(ERROR_ARGS "alias args must be NODE_LIT or NODE_DSYM");
|
||||||
}
|
}
|
||||||
s1 = node->u1.node->nd_lit;
|
s1 = node->u1.node->nd_lit;
|
||||||
s2 = node->u2.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;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_UNDEF:{
|
case NODE_UNDEF:{
|
||||||
if (nd_type(node->u2.node) != NODE_LIT) {
|
enum node_type t = nd_type(node->u2.node);
|
||||||
rb_bug("undef args must be NODE_LIT");
|
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,
|
ADD_INSN1(ret, nd_line(node), undef,
|
||||||
ID2SYM(rb_to_id(node->u2.node->nd_lit)));
|
ID2SYM(rb_to_id(node->u2.node->nd_lit)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user