From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id DE27E17DD19B for ; Sat, 20 Dec 2014 06:21:35 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id B20C9B5D889 for ; Sat, 20 Dec 2014 06:15:35 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 4170B97A826 for ; Sat, 20 Dec 2014 06:15:36 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h3nsl2-GFhxe for ; Sat, 20 Dec 2014 06:15:28 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 4BD3297A82C for ; Sat, 20 Dec 2014 06:15:28 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 701A395243E for ; Sat, 20 Dec 2014 06:15:27 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C5194120576; Sat, 20 Dec 2014 06:15:22 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by neon.ruby-lang.org (Postfix) with ESMTP id BF115120511 for ; Sat, 20 Dec 2014 06:15:12 +0900 (JST) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPSA id 71AE21F83E; Fri, 19 Dec 2014 21:15:11 +0000 (UTC) Date: Fri, 19 Dec 2014 21:15:11 +0000 From: Eric Wong To: Ruby developers Message-ID: <20141219211511.GA10772@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ML-Name: ruby-core X-Mail-Count: 66987 Subject: [ruby-core:66987] Re: [ruby-trunk - Feature #8543] rb_iseq_load X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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