[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Re: Problem with latest array.c changes

From: Yukihiro Matsumoto <matz@...>
Date: 2006-09-25 22:57:04 UTC
List: ruby-core #8924
Hi,

In message "Re: Problem with latest array.c changes"
    on Tue, 26 Sep 2006 00:24:36 +0900, "Kent Sibilev" <ksruby@gmail.com> writes:

|This change
|
|Mon Sep 25 21:24:54 2006  Yukihiro Matsumoto  <matz@ruby-lang.org>
|
|    * array.c (rb_ary_shift): should clear shifting top element.
|      [ruby-talk:216055]
|
|    * array.c (rb_ary_shift): avoid creating shared object if array
|      size is small.
|
|leads to
|
|irb(main):027:0> a = [:a] * 3
|=> [:a, :a, :a]
|irb(main):028:0> a
|=> [:a, :a, :a]
|irb(main):029:0> a.dup.shift
|=> :a
|irb(main):030:0> a
|=> [:a, :a, true]
|
|This patch seems to fix it

Ah, thank you for finding and fixing the bug.

							matz.

In This Thread