summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-25 15:37:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-25 15:37:05 +0000
commitb904e87f0857eb3d1c0fdc5a8fbc693221baefab (patch)
treea783b516179617d90d4b10edb9f51b7039456d1b /compile.c
parenta1cb9efd343c9150260d457dfea0005166858690 (diff)
* eval.c (ruby_exec_internal): do nothing if no code.
* compile.c (rb_iseq_compile): check node if NULL before check nd_type. [ruby-talk:252956] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/compile.c b/compile.c
index c539e93050..0c5770d31a 100644
--- a/compile.c
+++ b/compile.c
@@ -144,7 +144,10 @@ rb_iseq_compile(VALUE self, NODE *node)
rb_iseq_t *iseq;
GetISeqPtr(self, iseq);
- if (nd_type(node) == NODE_SCOPE) {
+ if (node == 0) {
+ COMPILE(ret, "nil", node);
+ }
+ else if (nd_type(node) == NODE_SCOPE) {
/* iseq type of top, method, class, block */
set_local_table(iseq, node->nd_tbl);
set_arguments(iseq, ret, node->nd_args);
@@ -197,9 +200,6 @@ rb_iseq_compile(VALUE self, NODE *node)
else if (iseq->type == ISEQ_TYPE_DEFINED_GUARD) {
COMPILE(ret, "defined guard", node);
}
- else if (node == 0) {
- COMPILE(ret, "nil", node);
- }
else {
rb_bug("unknown scope");
}