From 51ea2cf4e431d2265a255cb3bfedc91461acf8d4 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 26 Jan 2008 08:44:43 +0000 Subject: * compile.c (iseq_compile_each): validate argument expr of "next" statement. * bootstraptest/test_syntax.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 9509af073a..f6545d56d8 100644 --- a/compile.c +++ b/compile.c @@ -3044,6 +3044,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) LABEL *splabel = NEW_LABEL(0); debugs("next in while loop\n"); ADD_LABEL(ret, splabel); + COMPILE(ret, "next val/valid syntax?", node->nd_stts); add_ensure_iseq(ret, iseq); ADD_ADJUST(ret, nd_line(node), iseq->compile_data->redo_label); ADD_INSNL(ret, nd_line(node), jump, iseq->compile_data->start_label); -- cgit v1.2.3