diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-25 15:37:05 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-25 15:37:05 +0000 |
| commit | 1e136a934028ebf0bd66b16d76b1857655d1d21e (patch) | |
| tree | a783b516179617d90d4b10edb9f51b7039456d1b | |
| parent | bc1a2af520fd8d642c4260ee80c5bd1e530cc29f (diff) | |
| download | ruby-1e136a934028ebf0bd66b16d76b1857655d1d21e.tar.gz ruby-1e136a934028ebf0bd66b16d76b1857655d1d21e.tar.xz ruby-1e136a934028ebf0bd66b16d76b1857655d1d21e.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@12386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | compile.c | 8 | ||||
| -rw-r--r-- | eval.c | 2 |
3 files changed, 13 insertions, 4 deletions
@@ -1,3 +1,10 @@ +Sat May 26 00:38:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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] + Sat May 26 00:05:22 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> @@ -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"); } @@ -204,6 +204,8 @@ ruby_exec_internal(void) { int state; VALUE val; + + if (!ruby_eval_tree) return 0; PUSH_TAG(); if ((state = EXEC_TAG()) == 0) { GET_THREAD()->base_block = 0; |
