[#69616] [Ruby trunk - Feature #11258] add 'x' mode character for O_EXCL — cremno@...
Issue #11258 has been updated by cremno phobia.
3 messages
2015/06/16
[#69643] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — normalperson@...
Issue #11276 has been updated by Eric Wong.
3 messages
2015/06/17
[#69751] [Ruby trunk - Bug #11001] 2.2.1 Segmentation fault in reserve_stack() function. — kubo@...
Issue #11001 has been updated by Takehiro Kubo.
3 messages
2015/06/27
[ruby-core:69481] [Ruby trunk - Bug #11230] [Open] Should rb_struct_s_members() be public API?
From:
eregontp@...
Date:
2015-06-06 20:06:33 UTC
List:
ruby-core #69481
Issue #11230 has been reported by Benoit Daloze.
----------------------------------------
Bug #11230: Should rb_struct_s_members() be public API?
https://bugs.ruby-lang.org/issues/11230
* Author: Benoit Daloze
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
rb_struct_s_members() is declared in include/ruby/intern.h.
However it seems this is a fairly internal API as it returns an hidden Array.
For instance, there was a try to specify the behavior in
https://github.com/rubinius/rubinius/commit/2642a30c57973987d2a7b7e85b3ce1e78100a31b
but that produces only erratic behavior on MRI because that usage is not intended.
A valid usage might be:
static VALUE get_struct_member(VALUE self, VALUE obj, VALUE i) {
return RARRAY_AREF(rb_struct_s_members(obj), NUM2INT(i));
}
p get_struct_member(Struct.new(:a, :bb), 1)
But do we need such access and is it worth exposing a potentially dangerous function like this?
--
https://bugs.ruby-lang.org/