[#75225] [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7) — k@...
Issue #12324 has been reported by Kazuki Yamaguchi.
6 messages
2016/04/27
[#78693] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Eric Wong <normalperson@...>
2016/12/17
k@rhe.jp wrote:
[#78701] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Kazuki Yamaguchi <k@...>
2016/12/17
On Sat, Dec 17, 2016 at 01:31:12AM +0000, Eric Wong wrote:
[#78702] Re: [Ruby trunk Feature#12324] Support OpenSSL 1.1.0 (and drop support for 0.9.6/0.9.7)
— Eric Wong <normalperson@...>
2016/12/17
Kazuki Yamaguchi <k@rhe.jp> wrote:
[ruby-core:75103] [Ruby trunk Bug#12082] Tail-calling method can't catch exception raised by tail-called method
From:
usa@...
Date:
2016-04-22 08:07:56 UTC
List:
ruby-core #75103
Issue #12082 has been updated by Usaku NAKAMURA.
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
Bug #12082: Tail-calling method can't catch exception raised by tail-called method
https://bugs.ruby-lang.org/issues/12082#change-58233
* Author: Kazuki Yamaguchi
* Status: Closed
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v:
* Backport: 2.1: WONTFIX, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
The following code doesn't work as expected, on all versions of Ruby with tail call optimization (1.9.1 to 2.3.0).
~~~ruby
def do_raise
raise "should be rescued"
end
options = {
tailcall_optimization: true,
trace_instruction: false,
}
RubyVM::InstructionSequence.compile(<<EOF, __FILE__, __FILE__, __LINE__, options).eval
def test_rescue
return do_raise
1 + 2
rescue
:ok
end
EOF
p test_rescue # should print :ok, but raises "should be rescued"
~~~
Looks like `nop` instruction is (also) used to avoid this optimization ([compile.c](https://github.com/ruby/ruby/blob/1282a4a/compile.c#L4321)), but when doing early return, no `nop` is inserted.
I attached a (dirty) fix for this. Maybe there is a cleaner way.
---Files--------------------------------
0001-compile.c-don-t-do-tail-call-optimization-if-covered.patch (7.21 KB)
0001-compile.c-don-t-do-tail-call-optimization-if-covered-v2.patch (7.49 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>