[MacRuby] #860: Assertion fails in pop_current_exception when catch/throw used in rescue (was: Assertion fails when MacRuby should throw an exception of "OptionParser::AmbiguousOption".)
MacRuby
ruby-noreply at macosforge.org
Fri Aug 20 19:41:47 PDT 2010
#860: Assertion fails in pop_current_exception when catch/throw used in rescue
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
Description changed by martinlagardette@…:
Old description:
> Test Script:
> {{{
> #!ruby
> $ cat test_opt.rb
> require 'optparse'
>
> opt = OptionParser.new
> flag = self.class
>
> opt.def_option("--open") {|x|}
> opt.def_option("-x") {|x| flag = x}
> opt.def_option("--option") {|x| flag = x}
>
> begin
> opt.parse!(%w"--op")
> rescue => e
> p e
> end
>
> begin
> opt.parse!(%w"-o")
> rescue => e
> p e
> end
> }}}
>
> Result of Ruby 1.9.1:
> {{{
> $ ruby test_opt.rb
> #<OptionParser::AmbiguousOption: --op>
> #<OptionParser::AmbiguousOption: -o>
> }}}
>
> Result of MacRuby Trunk:
> {{{
> $ macruby test_opt.rb
> #<OptionParser::AmbiguousOption: --op>
> Assertion failed: ((size_t)pos < current_exceptions.size()), function
> pop_current_exception, file vm.cpp, line 3343.
> zsh: abort macruby test_opt.rb
> }}}
New description:
{{{
#!ruby
$ cat test_catch_throw.rb
begin
raise
rescue
catch(:ambiguous) { throw :ambiguous }
p :ok
end
}}}
Result of Ruby 1.9.1:
{{{
$ ruby test_catch_throw.rb
:ok
}}}
Result of MacRuby Trunk:
{{{
$ macruby test_catch_throw.rb
Assertion failed: ((size_t)pos < current_exceptions.size()), function
pop_current_exception, file vm.cpp, line 3343.
zsh: abort macruby test_opt.rb
}}}+
--
--
Ticket URL: <http://www.macruby.org/trac/ticket/860#comment:4>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list