[#103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 — eregontp@...
Issue #17777 has been reported by Eregon (Benoit Daloze).
17 messages
2021/04/05
[#103305] [Ruby master Feature#17785] Allow named parameters to be keywords — marcandre-ruby-core@...
Issue #17785 has been reported by marcandre (Marc-Andre Lafortune).
21 messages
2021/04/08
[#103342] [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity — jean.boussier@...
Issue #17790 has been reported by byroot (Jean Boussier).
14 messages
2021/04/09
[#103388] [ANN] Multi-factor Authentication of bugs.ruby-lang.org — SHIBATA Hiroshi <hsbt@...>
Hello,
5 messages
2021/04/12
[#103414] Re: [ANN] Multi-factor Authentication of bugs.ruby-lang.org
— Martin J. Dürst <duerst@...>
2021/04/13
SXMgdGhlcmUgYSB3YXkgdG8gdXNlIHRoaXMgbXVsdGktZmFjdG9yIGF1dGhlbnRpY2F0aW9uIGZv
[#103547] List of CI sites to check — Martin J. Dürst <duerst@...>
SGVsbG8gZXZlcnlib2R5LAoKRHVlIHRvIHZhcmlvdXMgcGVyc29uYWwgcmVhc29ucywgSSBoYXZl
4 messages
2021/04/22
[#103596] [Ruby master Feature#17830] Add Integer#previous and Integer#prev — rafasoaresms@...
Issue #17830 has been reported by rafasoares (Rafael Soares).
9 messages
2021/04/26
[ruby-core:103576] [Ruby master Bug#17822] Inconsistent visibility behavior with refinements
From:
XrXr@...
Date:
2021-04-23 17:33:52 UTC
List:
ruby-core #103576
Issue #17822 has been reported by alanwu (Alan Wu).
----------------------------------------
Bug #17822: Inconsistent visibility behavior with refinements
https://bugs.ruby-lang.org/issues/17822
* Author: alanwu (Alan Wu)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Running the following script, case 0 raises `NoMethodError` for privacy violation,
while all other cases print `:refined`. Shouldn't all three cases be equivalent?
```ruby
class A; end
module M
refine(A) { def foo; :refined; end }
end
case ARGV.first.to_i
when 0
class A
private def foo; end
end
when 1
class A
prepend(Module.new)
private def foo; end
end
when 2
class A
private
def foo; end
end
end
using(M)
p(A.new.foo)
```
---
Some analysis: case 0 on master(cb78aae) behaves differently from version 3.0.1.
Applying the patch from https://github.com/ruby/ruby/pull/4357 recovers the behavior
found on `3.0.1`. That patch plus the following diff makes case 0 behave like case 1 and 2.
```diff
diff --git a/vm_method.c b/vm_method.c
index 0f25c514a8..82ac3a60b3 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1399,11 +1399,16 @@ rb_export_method(VALUE klass, ID name, rb_method_visibility_t visi)
rb_vm_check_redefinition_opt_method(me, klass);
if (klass == defined_class || origin_class == defined_class) {
- METHOD_ENTRY_VISI_SET(me, visi);
-
- if (me->def->type == VM_METHOD_TYPE_REFINED && me->def->body.refined.orig_me) {
- METHOD_ENTRY_VISI_SET((rb_method_entry_t *)me->def->body.refined.orig_me, visi);
- }
+ if (me->def->type == VM_METHOD_TYPE_REFINED) {
+ // Refinement method entries should always be public because the refinement
+ // search is always performed.
+ if (me->def->body.refined.orig_me) {
+ METHOD_ENTRY_VISI_SET((rb_method_entry_t *)me->def->body.refined.orig_me, visi);
+ }
+ }
+ else {
+ METHOD_ENTRY_VISI_SET(me, visi);
+ }
rb_clear_method_cache(klass, name);
}
else {
```
--
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>