summaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-03 19:11:49 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-03 19:11:49 +0000
commit9718767ac63946f463bda58fd499b263fc55690d (patch)
tree4afa1ee916597c6a307dc3bc90322792c077ec83 /compile.c
parent82733707f1aa3990ad2b7b80d430ef614284340f (diff)
downloadruby-9718767ac63946f463bda58fd499b263fc55690d.tar.gz
ruby-9718767ac63946f463bda58fd499b263fc55690d.tar.xz
ruby-9718767ac63946f463bda58fd499b263fc55690d.zip
* compile.c (compile_array): ignore NODE_ZARRAY.
[ruby-dev:31110] * bootstraptest/test_method.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index 02f221494..73b761c2d 100644
--- a/compile.c
+++ b/compile.c
@@ -1831,18 +1831,20 @@ compile_array(rb_iseq_t *iseq,
int len = node->nd_alen, line = nd_line(node), i=0;
DECL_ANCHOR(anchor);
- while (node) {
- if (nd_type(node) != NODE_ARRAY) {
- rb_bug("compile_array: This node is not NODE_ARRAY, but %s",
- ruby_node_name(nd_type(node)));
- }
+ if (nd_type(node) != NODE_ZARRAY) {
+ while (node) {
+ if (nd_type(node) != NODE_ARRAY) {
+ rb_bug("compile_array: This node is not NODE_ARRAY, but %s",
+ ruby_node_name(nd_type(node)));
+ }
- i++;
- if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
- opt_p = Qfalse;
+ i++;
+ if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
+ opt_p = Qfalse;
+ }
+ COMPILE(anchor, "array element", node->nd_head);
+ node = node->nd_next;
}
- COMPILE(anchor, "array element", node->nd_head);
- node = node->nd_next;
}
if (len != i) {