[前][次][番号順一覧][スレッド一覧][生データ]

yarv-dev:1047

From: SASADA Koichi <ko1 atdot.net>
Date: Thu, 20 Jul 2006 03:42:21 +0900
Subject: [yarv-dev:1047] fixed> Re: open> InstructionSequence.load dumps core

 ささだです。

 rb_bug を使う代わりに、
 rb_raise(rb_eTypeError, "unexpected object for instruction");

 としてみました。例外の代わりに rb_bug を使っているところは結構ありま
す。未だにどの例外クラスにするべきか迷うもので。なんかいい指針はないです
かね。


sheepman wrote:
> こんばんは、sheepman です。
> 以下のようなコードで落ちるのは、こういうもんなんでしょうか。
> 
> $ cat t.rb
> iseq = YARVCore::InstructionSequence.compile('1')
> a = iseq.to_a
> a[-1] = a
> YARVCore::InstructionSequence.load(a)
> 
> $ ruby-2.0 -v t.rb ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-linux]
> YARVCore 0.4.1 Rev: 525 (2006-07-18) [opts: [direct threaded code] [inline method cache] ]
> warning: useless use of a literal in void context
> -- stack frame ------------
> 0000 (0x402b0008): 00000004
> 0001 (0x402b000c): 00000005
> 0002 (0x402b0010): 402961bc
> 0003 (0x402b0014): 40296158
> 0004 (0x402b0018): 00000004
> 0005 (0x402b001c): 00000001
> 0006 (0x402b0020): 40298b88
> 0007 (0x402b0024): 40296158
> 0008 (0x402b0028): 00000004
> 0009 (0x402b002c): 00000001 <- lfp <- dfp
> -- control frame ----------
> c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :load
> c:0003 p:0059 s:0006 b:0006 l:000005 d:000005 TOP    t.rb:4
> c:0002 p:---- s:0002 b:0002 l:000001 d:000001 FINISH
> c:0001 p:---- s:0000 b:-001 l:000000 d:000000 ------
> ---------------------------
> DBG> : "t.rb:4:in `<main>'"
> [BUG] unexpected object
> ruby 2.0.0 (2006-04-08) [i686-linux]
> 
> zsh: abort      ruby-2.0 -v t.rb
> 


-- 
// SASADA Koichi at atdot dot net


--
ML: yarv-dev quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]

      1035 2006-07-15 19:22 [sheepman sheepman.sa] open> InstructionSequence.load dumps core
      1038 2006-07-18 16:51 ┗[ko1 atdot.net       ] fixed> Re: open> InstructionSequence.load dumps core
      1041 2006-07-19 21:47  ┗[sheepman sheepman.sa] Re: open> InstructionSequence.load dumps core
->    1047 2006-07-20 03:42   ┗[ko1 atdot.net       ] fixed> Re: open> InstructionSequence.load dumps core