ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Ruby developers <ruby-core@ruby-lang.org>
Subject: [ruby-core:66987] Re: [ruby-trunk - Feature #8543] rb_iseq_load
Date: Fri, 19 Dec 2014 21:15:11 +0000	[thread overview]
Message-ID: <20141219211511.GA10772@dcvr.yhbt.net> (raw)
In-Reply-To: <redmine.journal-50248.20141201223839.3a167b95fb8bfadb@ruby-lang.org>

I think the stack mismatches in current trunk are hard to avoid, but the
loaded bytecode is still valid and runnable for the currently-skipped
cases.  I propose the following to test more thoroughly.

diff --git a/test/-ext-/iseq_load/test_iseq_load.rb b/test/-ext-/iseq_load/test_iseq_load.rb
index 5bbd49e..7251603 100644
--- a/test/-ext-/iseq_load/test_iseq_load.rb
+++ b/test/-ext-/iseq_load/test_iseq_load.rb
@@ -52,16 +52,21 @@ class TestIseqLoad < Test::Unit::TestCase
   end
 
   def test_next_in_block_in_block
-    skip "failing due to stack_max mismatch"
-    assert_iseq_roundtrip <<-'end;'
-      3.times { 3.times { next } }
+    @next_broke = false
+    src = <<-'end;'
+      3.times { 3.times { next; @next_broke = true } }
     end;
+    a = ISeq.compile(src).to_a
+    iseq = ISeq.iseq_load(a)
+    iseq.eval
+    assert_equal false, @next_broke
+    skip "failing due to stack_max mismatch"
+    assert_iseq_roundtrip(src)
   end
 
   def test_break_ensure
-    skip "failing due to exception entry sp mismatch"
-    assert_iseq_roundtrip <<-'end;'
-      def m
+    src = <<-'end;'
+      def test_break_ensure_def_method
         bad = true
         while true
           begin
@@ -70,8 +75,15 @@ class TestIseqLoad < Test::Unit::TestCase
             bad = false
           end
         end
+        bad
       end
     end;
+    a = ISeq.compile(src).to_a
+    iseq = ISeq.iseq_load(a)
+    iseq.eval
+    assert_equal false, test_break_ensure_def_method
+    skip "failing due to exception entry sp mismatch"
+    assert_iseq_roundtrip(src)
   end
 
   # FIXME: still failing

  reply	other threads:[~2014-12-19 21:21 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 12:39 [ruby-core:55557] [ruby-trunk - misc #8543][Open] rb_iseq_load alvoskov (Alexey Voskov)
2013-06-20  7:40 ` [ruby-core:55568] [ruby-trunk - Bug #8543] rb_iseq_load nagachika (Tomoyuki Chikanaga)
2014-01-30  6:17 ` [ruby-core:60299] " shibata.hiroshi
2014-04-16  8:25 ` [ruby-core:62050] " billk
2014-04-16 10:21 ` [ruby-core:62052] " billk
2014-06-26 23:40 ` [ruby-core:63353] " billk
2014-06-30  8:07 ` [ruby-core:63427] " naruse
2014-07-26  5:42 ` [ruby-core:64033] " ko1
2014-07-26  5:46 ` [ruby-core:64034] [ruby-trunk - Feature " nobu
2014-10-09  7:18 ` [ruby-core:65555] " billk
2014-10-09  7:44   ` [ruby-core:65556] " Eric Wong
2014-10-09  7:51 ` [ruby-core:65557] " normalperson
2014-10-09 23:44 ` [ruby-core:65574] " billk
2014-11-22  0:03   ` [ruby-core:66402] " Eric Wong
2014-11-22  1:06     ` [ruby-core:66404] " Eric Wong
2014-11-22  8:19   ` [ruby-core:66409] " Eric Wong
2014-11-23  5:56     ` [ruby-core:66423] " Eric Wong
2014-11-22  0:08 ` [ruby-core:66403] " normalperson
2014-11-22  1:08 ` [ruby-core:66405] " normalperson
2014-11-22  8:28 ` [ruby-core:66410] " normalperson
2014-11-23  5:58 ` [ruby-core:66424] " normalperson
2014-11-24 23:13 ` [ruby-core:66446] " billk
2014-11-25  2:01   ` [ruby-core:66450] " Eric Wong
2014-11-25  2:08 ` [ruby-core:66451] " normalperson
2014-11-25  3:09 ` [ruby-core:66452] " billk
2014-11-25  8:19 ` [ruby-core:66456] " ko1
2014-11-26  1:38   ` [ruby-core:66465] " Eric Wong
2014-11-26  1:48 ` [ruby-core:66467] " normalperson
2014-11-26  6:49 ` [ruby-core:66472] " ko1
2014-11-26  8:09   ` [ruby-core:66476] " Eric Wong
2014-11-26  8:18 ` [ruby-core:66478] " normalperson
2014-11-27  3:02   ` [ruby-core:66508] " Eric Wong
2014-11-27  3:08 ` [ruby-core:66510] " normalperson
2014-11-29 11:55 ` [ruby-core:66566] " s.wanabe
2014-12-01 22:35   ` [ruby-core:66633] " Eric Wong
2014-12-01 22:38 ` [ruby-core:66634] " normalperson
2014-12-19 21:15   ` Eric Wong [this message]
2014-12-19 21:18 ` [ruby-core:66988] " normalperson
2015-09-09 23:27 ` [ruby-core:70708] [Ruby trunk - Feature #8543] new rb_iseq_load crash billk
2015-09-10  0:09 ` [ruby-core:70709] " billk
2015-09-10 14:12 ` [ruby-core:70711] [Ruby trunk - Bug " nagachika00
2015-09-10 16:42   ` [ruby-core:70713] " Bill Kelly
2015-09-10 16:54     ` [ruby-core:70714] " U.NAKAMURA
2015-09-10 17:14       ` [ruby-core:70715] " Bill Kelly
2015-09-11  1:35     ` [ruby-core:70722] " Nobuyoshi Nakada
2015-11-24 15:43 ` [ruby-core:71653] " nagachika00
2015-12-08  3:11 ` [ruby-core:71930] " usa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141219211511.GA10772@dcvr.yhbt.net \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).