aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-02 05:56:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-02 05:56:06 +0000
commit8a6f99e07846af891e439df2ee7f35484aa9dedc (patch)
tree092d1cd4a1f9d1c40083b9a9f497ec36b68f6441
parent41e607632e74305e2e2a393659241ec0e6f05650 (diff)
downloadruby-8a6f99e07846af891e439df2ee7f35484aa9dedc.tar.gz
compile.c: restore catch entry sp
* compile.c (iseq_build_from_ary_exception): restore stack depth of catch entries. accurate stack depths cannot be calculated from dumped array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--compile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 6ef737d11d..ff5651d3a4 100644
--- a/compile.c
+++ b/compile.c
@@ -6597,7 +6597,14 @@ iseq_build_from_ary_exception(rb_iseq_t *iseq, struct st_table *labels_table,
lcont = register_label(iseq, labels_table, ptr[4]);
sp = NUM2UINT(ptr[5]);
- (void)sp;
+ /* TODO: Dirty Hack! Fix me */
+ if (type == CATCH_TYPE_RESCUE ||
+ type == CATCH_TYPE_BREAK ||
+ type == CATCH_TYPE_NEXT) {
+ ++sp;
+ }
+
+ lcont->sp = sp;
ADD_CATCH_ENTRY(type, lstart, lend, eiseq, lcont);