summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-03 14:00:41 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-03 14:00:41 +0000
commit9b586688074a127cf51d162c3de6eb262488f132 (patch)
tree9ee2428553eb12a092fa722282d9ad42ea834f87 /compile.c
parentb08e0ade5baacbc7d4754e9f6afe8d09a3e00bc5 (diff)
merge revision(s) 59169: [Backport #13678]
compile.c: toplevel return in argument * compile.c (iseq_compile_each0): adjust the stack before return in an evstr/argument (reported by Balazs <balazs@kutilovi.cz>) to fix stack consistency error. [ruby-core:81761] [Bug #13678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 67ae07064d..d6c897a332 100644
--- a/compile.c
+++ b/compile.c
@@ -5479,6 +5479,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
if (type == ISEQ_TYPE_TOP || type == ISEQ_TYPE_MAIN ||
((type == ISEQ_TYPE_RESCUE || type == ISEQ_TYPE_ENSURE) &&
(parent_type == ISEQ_TYPE_TOP || parent_type == ISEQ_TYPE_MAIN))) {
+ ADD_ADJUST(ret, line, 0);
ADD_INSN(ret, line, putnil);
ADD_INSN(ret, line, leave);
}