Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112018-02-12T21:04:28ZRuby Issue Tracking System
Redmine Ruby master - Feature #14468 (Rejected): Add Proc#dighttps://bugs.ruby-lang.org/issues/144682018-02-12T21:04:28Zbradleybuda (Bradley Buda)bradleybuda@gmail.com
<p>Since Proc already responds to [], it would be cool if Procs could participate in a recursive dig. Like this:</p>
<p>Current Behavior:</p>
<pre><code>obj = [
0,
{
a: ->(x) { x * 2 },
b: "c"
},
]
obj[1][:a][4] == 8 # true
obj.dig(1, :a, 4) == 8 # TypeError (Proc does not have #dig method)
</code></pre>
<p>Desired behavior:</p>
<pre><code>obj.dig(1, :a, 4) == 8 # true
</code></pre>
<p>I am willing to implement this but I wanted to see if the devs think it is a good idea first. If there are no objections, I'll put together a patch.</p> Ruby master - Bug #9150 (Closed): Segfault in case statement execution, possibly related to refin...https://bugs.ruby-lang.org/issues/91502013-11-25T14:58:47Zbradleybuda (Bradley Buda)bradleybuda@gmail.com
<p>This code consistently segfaults in 2.0.0p353:</p>
<p>require 'active_support/all'</p>
<p>case 3600<br>
when 1.week then true<br>
end</p>
<p>This is after <code>gem install activesupport --version=3.2.13</code>. The code works fine in 2.0.0p247.</p>
<p>I ran a git bisect between the two patches and I've narrowed it down to this change: <a href="https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/42869" class="external">https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/42869</a> . I don't know enough about ruby's internals to debug this any further, but according to LLDB the problem is a null pointer dereference in vm_eval.c:</p>
<p>141 {<br>
142 VALUE ret;<br>
143<br>
144 if (!ci->me->def) return Qnil;<br>
145<br>
146 if (th->passed_block) {<br>
147 ci->blockptr = (rb_block_t *)th->passed_block;</p>
<p>ci->me is null on line 144.</p>
<p>I can reproduce this error on both OSX and Linux. Let me know if I can provide any more info to help debug this.</p>