[#75687] [Ruby trunk Bug#12416] struct rb_id_table lacks mark function — shyouhei@...
Issue #12416 has been reported by Shyouhei Urabe.
3 messages
2016/05/23
[#75763] [Ruby trunk Feature#12435] Using connect_nonblock to open TCP connections in Net::HTTP#connect — mohamed.m.m.hafez@...
Issue #12435 has been reported by Mohamed Hafez.
3 messages
2016/05/28
[#75774] Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock — Mohamed Hafez <mohamed.m.m.hafez@...>
Hi all, every now and then in my production server, I'm
4 messages
2016/05/30
[#75775] Re: Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock
— Mohamed Hafez <mohamed.m.m.hafez@...>
2016/05/30
Or does MRI's OpenSSL::SSL::SSLSocket#connect_nonblock just return
[#75782] Important: Somewhat backwards-incompatible change (Fwd: [ruby-cvs:62388] duerst:r55225 (trunk): * string.c: Activate full Unicode case mapping for UTF-8) — Martin J. Dürst <duerst@...>
With the change below, I have activated full Unicode case mapping for
4 messages
2016/05/31
[ruby-core:75449] [Ruby trunk Bug#12367] [PATCH] Declaring an already defined class with Object as the new superclass does not raise an error
From:
nobu@...
Date:
2016-05-10 11:54:42 UTC
List:
ruby-core #75449
Issue #12367 has been updated by Nobuyoshi Nakada.
Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
Bug #12367: [PATCH] Declaring an already defined class with Object as the new superclass does not raise an error
https://bugs.ruby-lang.org/issues/12367#change-58567
* Author: Benoit Daloze
* Status: Assigned
* Priority: Normal
* Assignee: Benoit Daloze
* ruby -v:
* Backport: 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
For example:
~~~ ruby
class SuperclassIgnoresObject < A
end
SuperclassIgnoresObject.superclass # A
class SuperclassIgnoresObject < Object # Should raise a superclass mismatch but it doesn't.
end
SuperclassIgnoresObject.superclass # A
~~~
This seems an unintended side-effect of using Object as the default superclass in the code and not differentiating given/non-given superclass.
In insns.def defineclass:
~~~ c
if (super == Qnil) {
super = rb_cObject;
}
...
if (super != rb_cObject) {
// check is superclass mismatch
}
~~~
Proposed patch:
~~~ diff
diff --git a/insns.def b/insns.def
index d34a663..ae7f98f 100644
--- a/insns.def
+++ b/insns.def
@@ -865,10 +865,6 @@ defineclass
rb_obj_class(super));
}
- if (super == Qnil) {
- super = rb_cObject;
- }
-
vm_check_if_namespace(cbase);
/* find klass */
@@ -881,7 +877,7 @@ defineclass
rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a class", rb_id2str(id));
}
- if (super != rb_cObject) {
+ if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
VALUE tmp;
tmp = rb_class_real(RCLASS_SUPER(klass));
@@ -892,6 +888,9 @@ defineclass
}
}
else {
+ if (!VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
+ super = rb_cObject;
+ }
/* new class declaration */
klass = rb_define_class_id(id, super);
rb_set_class_path_string(klass, cbase, rb_id2str(id));
~~~
Can I commit?
--
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>