зеркало из https://github.com/github/ruby.git
* compile.c : treat []&&= in virtually the same way as []||=.
[ruby-dev:34679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
fc0babb4c2
Коммит
62b6a462d7
|
@ -1,3 +1,8 @@
|
|||
Mon Jun 9 22:46:47 2008 wanabe <s.wanabe@gmail.com>
|
||||
|
||||
* compile.c : treat []&&= in virtually the same way as []||=.
|
||||
[ruby-dev:34679]
|
||||
|
||||
Mon Jun 9 21:17:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enc/depend (clean): remove build directories.
|
||||
|
|
|
@ -3513,7 +3513,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
|||
}
|
||||
else {
|
||||
/* and */
|
||||
ADD_INSN(ret, nd_line(node), dup);
|
||||
ADD_INSNL(ret, nd_line(node), branchunless, label);
|
||||
ADD_INSN(ret, nd_line(node), pop);
|
||||
}
|
||||
|
||||
COMPILE(ret, "NODE_OP_ASGN1 args->head: ", node->nd_args->nd_head);
|
||||
|
@ -3529,17 +3531,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
|||
}
|
||||
ADD_INSNL(ret, nd_line(node), jump, lfin);
|
||||
ADD_LABEL(ret, label);
|
||||
if (id == 0) { /* or */
|
||||
if (id == 0 || id == 1) { /* 0: or, 1: and */
|
||||
ADD_INSN(ret, nd_line(node), swap);
|
||||
ADD_INSN(ret, nd_line(node), pop);
|
||||
ADD_INSN(ret, nd_line(node), swap);
|
||||
ADD_INSN(ret, nd_line(node), pop);
|
||||
}
|
||||
else if (id == 1) { /* and */
|
||||
ADD_INSN(ret, nd_line(node), pop);
|
||||
ADD_INSN(ret, nd_line(node), pop);
|
||||
ADD_INSN(ret, nd_line(node), putnil);
|
||||
}
|
||||
ADD_LABEL(ret, lfin);
|
||||
}
|
||||
else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче