Commit graph

64552 commits

Author SHA1 Message Date
Aaron Patterson
5483bf8fa4
add T_ZOMBIE support to lldb scripts 2020-08-27 09:00:19 -07:00
Jeremy Evans
c60aaed185
Fix Method#super_method for aliased methods
Previously, Method#super_method looked at the called_id to
determine the method id to use, but that isn't correct for
aliased methods, because the super target depends on the
original method id, not the called_id.

Additionally, aliases can reference methods defined in other
classes and modules, and super lookup needs to start in the
super of the defined class in such cases.

This adds tests for Method#super_method for both types of
aliases, one that uses VM_METHOD_TYPE_ALIAS and another that
does not.  Both check that the results for calling super
methods return the expected values.

To find the defined class for alias methods, add an rb_ prefix
to find_defined_class_by_owner in vm_insnhelper.c and make it
non-static, so that it can be called from method_super_method
in proc.c.

This bug was original discovered while researching [Bug #11189].

Fixes [Bug #17130]
2020-08-27 08:37:03 -07:00
git
f41bd0d708 * 2020-08-28 [ci skip] 2020-08-28 00:06:25 +09:00
Nobuyoshi Nakada
280d028125 [ruby/stringio] Bump version to 0.1.4
64f2360d38
2020-08-27 23:55:17 +09:00
Leam Hall
f4b9e94317
[ruby/io-console] Bug 17128: In test_set_winsize_console, wrapped re-size in a begin-rescue-else.
a22333c33a
2020-08-27 23:46:02 +09:00
Yoann Lecuyer
b3c1c767ea [stringio] fix stringio codepoint enumerator off by one error 2020-08-27 23:41:22 +09:00
Nobuyoshi Nakada
96d701f737
Adjust indents [ci skip] 2020-08-27 23:39:15 +09:00
Burdette Lamar
b8bfb1d5f5
Comply with guide for method doc: hash.c (#3459)
Instance methods considered (some maybe not changed):

    clear
    []=
    replace
    length
    empty?
    each_value
    each_key
    each_pair
    transform_keys
    transform_keys!
    transform_values
    transform_values!
2020-08-27 08:31:32 -05:00
卜部昌平
490010084e sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
卜部昌平
5ca44076f4 include/ruby/backward/2/rmodule.h: deprecate
Only one function in only one file uses contents of this public header.
That is not a wise idea.  Let's just free the header's soul.
2020-08-27 16:42:06 +09:00
Kir Shatrov
2038cc6cab
Make Socket.getaddrinfo interruptible (#2827)
Before, Socket.getaddrinfo was using a blocking getaddrinfo(3) call.
That didn't allow to wrap it into Timeout.timeout or interrupt the thread in any way.

Combined with the default 10 sec resolv timeout on many Unix systems, this can
have a very noticeable effect on production Ruby apps being not
resilient to DNS outages and timing out name resolution, and being unable to fail fast even
with Timeout.timeout.

Since we already have support for getaddrinfo_a(3), the async version
of getaddrinfo, we should be able to make Socket.getaddrinfo leverage that
when getaddrinfo_a version is available in the system (hence #ifdef
HAVE_GETADDRINFO_A).

Related tickets:
https://bugs.ruby-lang.org/issues/16476
https://bugs.ruby-lang.org/issues/16381
https://bugs.ruby-lang.org/issues/14997
2020-08-27 16:39:13 +09:00
卜部昌平
1035a3b202 RUBY_SHOW_COPYRIGHT_TO_DIE: flip the default
Commit 7aab062ef3 says:

> ruby_show_version() will no longer exits the process, if
> RUBY_SHOW_COPYRIGHT_TO_DIE is set to 0.  This will be the default in
> the future.

3.0 is a good timing for that "future".
2020-08-27 15:04:00 +09:00
卜部昌平
756403d775 sed -i '/r_cast.h/d' 2020-08-27 15:03:36 +09:00
卜部昌平
cd1d6d9029 include/ruby/backward/2/r_cast.h: deprecate
Remove all usages of RCAST() so that the header file can be excluded
from ruby/ruby.h's dependency.
2020-08-27 15:03:36 +09:00
卜部昌平
442525527e improve deprecation warning
We should not recommend RBIMPL_*.
2020-08-27 15:02:52 +09:00
卜部昌平
21b3bc10d3 DEPRECATED_TYPE: is deprecated
Nobody uses this macro any longer.
2020-08-27 15:02:52 +09:00
卜部昌平
3437e6247d RClassDeprecated: delete
It has been deprecated for 5 years since 1f22556040.
2020-08-27 15:02:52 +09:00
Kazuhiro NISHIYAMA
3353baac3d
Use own mutex instead of Thread.exclusive
ref [Feature #17125]
2020-08-27 14:37:03 +09:00
卜部昌平
5ae2c1b093 git rm include/ruby/backward/rubyio.h 2020-08-27 14:27:21 +09:00
卜部昌平
6ec6dd3ed7 git rm include/ruby/backward/rubysig.h 2020-08-27 14:11:59 +09:00
卜部昌平
5ca7b6abde git rm include/ruby/backward/{st,util}.h 2020-08-27 14:09:18 +09:00
git
d9c93a0d90 * 2020-08-27 [ci skip] 2020-08-27 14:08:21 +09:00
卜部昌平
6b6a4471d6 rb_deprecated_classext_struct: delete
Used from nowhere any longer.
2020-08-27 14:08:04 +09:00
卜部昌平
4bc3846389 git rm include/ruby/backward/classext.h 2020-08-27 14:08:04 +09:00
卜部昌平
0da2a3f1fc sed -i '\,2/extern.h,d' 2020-08-27 14:07:49 +09:00
卜部昌平
b2e1688e7d git rm include/ruby/backward/2/extern.h 2020-08-27 14:07:49 +09:00
Nobuyoshi Nakada
445e5548c9
Fixed error messages at non-ascii %string terminator 2020-08-26 21:36:22 +09:00
Nobuyoshi Nakada
cc36b5d4ac
Removed a never-true condition 2020-08-26 21:16:51 +09:00
Kenta Murata
72cb9bc55f
[webrick][DOC] Describe the stance of WEBrick about its security and utilization (#3457)
WEBrick is not recommended for the production use.  We need to explicitly
describe this fact in the document to avoid troubles due to misunderstanding.
2020-08-26 14:28:05 +09:00
Burdette Lamar
a84a2e872f
Comply with guide for method doc: hash.c (#3454)
Methods reviewed (a few not modified):

    key
    delete
    shift
    delete_if
    reject!
    reject
    slice
    except
    values_at
    fetch_values
    select
    select!
    keep_if
2020-08-25 16:09:31 -05:00
Lars Kanis
92b2d5816a Add documentation to "dcompact" callback and "parent" member 2020-08-25 10:50:51 -07:00
Peter Zhu
326d89b7ce Correctly account for heap_pages_final_slots so it does not underflow
`rb_objspace_call_finalizer` creates zombies, but does not do the correct accounting (it should increment `heap_pages_final_slots` whenever it creates a zombie). When we do correct accounting, `heap_pages_final_slots` should never underflow (the check for underflow was introduced in 39725a4db6).

The implementation moves the accounting from the functions that call `make_zombie` into `make_zombie` itself, which reduces code duplication.
2020-08-25 10:14:10 -07:00
git
8c030b5c00 * 2020-08-26 [ci skip] 2020-08-26 00:47:44 +09:00
Burdette Lamar
36cc53daae
Comply with guide for method doc: hash.c (#3451)
Methods:

    ::new
    ::[]
    ::try_convert
    #rehash
    #[]
    #fetch
    #default
    #default=
    #default_proc
    #default_proc=
2020-08-25 10:47:23 -05:00
Hiroshi SHIBATA
2e3a7f70ae
Promote nkf to default gems 2020-08-25 21:17:19 +09:00
Lars Kanis
8d68f54c94 Fix erb executable
Run ERb processing unconditionally since __FILE__ and $0 doesn't match
in a gem context.
2020-08-25 18:11:43 +09:00
Hiroshi SHIBATA
e6ac1fb612
Specify the executable of erb 2020-08-25 08:44:14 +09:00
git
1b34d843ea * 2020-08-25 [ci skip] 2020-08-25 08:11:07 +09:00
Jeremy Evans
9e25eb308d Update PTY.open documentation to document it yields a single argument [ci skip]
For a regular block, accepting two arguments is fine as the array
will be autosplatted.   However, a lambda that accepts two arguments
will not work.

We could change the implementation to yield two arguments instead
of an array with a single argument, but that would be less backwards
compatible.

I'm only changing the call-seq to be precise, other examples pass
a literal block that accepts two arguments, and I left those alone
as that will be the most common usage.

Fixes [Bug #17094]
2020-08-24 16:09:22 -07:00
Hiroshi SHIBATA
1eb1add68a
Added entry for changes of default gems 2020-08-24 19:24:07 +09:00
Kazuhiro NISHIYAMA
cb7634c142
Fix links [ci skip] 2020-08-24 15:58:52 +09:00
Yusuke Endoh
09acafaccf NEWS.md: add an example, add references, and move some items 2020-08-24 15:38:03 +09:00
git
f292bb245e * 2020-08-24 [ci skip] 2020-08-24 02:10:21 +09:00
Burdette Lamar
1d3e87a28c
Remove checks for self returned in array.c and hash.c examples (#3446)
Further compliance with https://github.com/ruby/ruby/blob/master/doc/method_documentation.rdoc#details-and-examples-
2020-08-23 12:10:01 -05:00
Kazuhiro NISHIYAMA
30ccc7d04b
Fix typos 2020-08-23 22:46:04 +09:00
git
4f7ff9c99d * 2020-08-23 [ci skip] 2020-08-23 21:46:13 +09:00
卜部昌平
2c4c088aa3 .github/workflows/compilers.yml: more compilers
Added some cross compilers that we can run on GitHub Workflow runner
environments.  Because they are cross compilers we cannot run the
generated binary.  The added matrix are compile-only.
2020-08-23 21:45:46 +09:00
卜部昌平
2ddc67ffb6 configure.ac: suppress more Sun C warnings.
They are rather annoying than being useful to us.
2020-08-22 14:12:12 +09:00
卜部昌平
331d02038b .travis.yml: prefer gcc
It seems `clang --save-temps` does not interface well with
tool/update-deps.  Prefer gcc for that purpose.
2020-08-22 11:12:24 +09:00
卜部昌平
d916a4c897 configure.ac: more checks on STRIP
STRIP now depends on compilers, not on OS.  Previous check against
$target_os does no longer work.
2020-08-22 09:49:08 +09:00