[前][次][番号順一覧][スレッド一覧]

ruby-changes:45425

From: nobu <ko1@a...>
Date: Thu, 2 Feb 2017 14:56:11 +0900 (JST)
Subject: [ruby-changes:45425] nobu:r57498 (trunk): compile.c: restore catch entry sp

nobu	2017-02-02 14:56:06 +0900 (Thu, 02 Feb 2017)

  New Revision: 57498

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57498

  Log:
    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.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 57497)
+++ compile.c	(revision 57498)
@@ -6597,7 +6597,14 @@ iseq_build_from_ary_exception(rb_iseq_t https://github.com/ruby/ruby/blob/trunk/compile.c#L6597
 	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);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]