summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-10extracted declare_underNobuyoshi Nakada
2019-10-10Simplify rb_define_module_idAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/2544
2019-10-10* 2019-10-10 [ci skip]git
2019-10-10fix memory corruption in old GCC卜部昌平
This typo introduced memory corruption when __builtin_add_overflow is not available but uint128_t is. GCC before 5 are one of such situatins. See also https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20191009T120004Z.log.html.gz
2019-10-09Prefer st_is_member over st_lookup with 0Ben Woosley
The st_is_member DEFINE has simpler semantics, for more readable code. Notes: Merged: https://github.com/ruby/ruby/pull/1622
2019-10-09Share ruby_sighandler_t definitionNobuyoshi Nakada
2019-10-09signal.c: save the original sighandlers for fatal signalsYusuke Endoh
On Android, a signal handler that is not SIG_DFL is set by default for SIGSEGV. Ruby's install_sighandler inserts Ruby's handler only when the signal has no handler, so it does not insert Ruby's SEGV report handler, which caused some test failures. This changeset forces to install Ruby's handler for some fatal signals (sigbus, sigsegv, and sigill). They keep the original handlers, and call them when the interpreter receives the signals.
2019-10-09error.c (rb_bug_for_fatal_signal): renamed from rb_bug_contextYusuke Endoh
Just refactoring. The name "rb_bug_context" is completely unclear for me. (Can you see that "context" means "machine register context"?) The context is available only when a fatal signal (sigbus, sigsegv, or sigill) is received; in fact, the function is used only for fatal signals. So, I think the name should be changed.
2019-10-09signal.c (ruby_abort): move the definition for refactoringYusuke Endoh
The three functions for fatal signals, sigbus, sigsegv, and sigill, are a family. The definition of ruby_abort had interrupted them for no reason. This change just moves the definition after the family.
2019-10-09Check '[ci skip]' at job levelKazuhiro NISHIYAMA
2019-10-09vm_eval.c (rb_adjust_argv_kw_splat): avoid memcpy with zero lengthYusuke Endoh
A method call is often with `argc = 1` and `argv = &v` where v is a VALUE, and some functions shift the arguments by `argc-1` and `argv+1` (for example, rb_sym_proc_call). I'm unsure whether it is safe or not to pass a pointer `argv+1` to memcpy with zero length, but Coverity Scan complains it. So this attempts to suppress the warning by explicit check of the length.
2019-10-09Remove uselsess shebangPavel Valena
as the file is not executable anyway. Notes: Merged: https://github.com/ruby/ruby/pull/2483
2019-10-09Update required_ruby_version to 2.4.0aycabta
2019-10-09Improve performance of Array#sum with float elements (#1555)Watson
The declaration of local variable in loop, it will initialize local variable for each run of the loop with clang generated code. So, it shouldn't declare the local variable in heavy loop. Array#sum with float elements will be faster around 30%. * Before user system total real 3.320000 0.010000 3.330000 ( 3.336088) * After user system total real 2.590000 0.010000 2.600000 ( 2.602399) * Test code require 'benchmark' Benchmark.bmbm do |x| ary = [] 10000.times { ary << Random.rand } x.report do 50000.times do ary.sum end end end
2019-10-09avoid returning NULL from xrealloc卜部昌平
This changeset is to kill future possibility of bugs similar to CVE-2019-11932. The vulnerability occurs when reallocarray(3) (which is a variant of realloc(3) and roughly resembles our ruby_xmalloc2()) returns NULL. In our C API, ruby_xmalloc() never returns NULL to raise NoMemoryError instead. ruby_xfree() does not return NULL by definition. ruby_xrealloc() on the other hand, _did_ return NULL, _and_ also raised sometimes. It is very confusing. Let's not do that. x-series APIs shall raise on error and shall not return NULL. Notes: Merged: https://github.com/ruby/ruby/pull/2540
2019-10-09avoid overflow in integer multiplication卜部昌平
This changeset basically replaces `ruby_xmalloc(x * y)` into `ruby_xmalloc2(x, y)`. Some convenient functions are also provided for instance `rb_xmalloc_mul_add(x, y, z)` which allocates x * y + z byes. Notes: Merged: https://github.com/ruby/ruby/pull/2540
2019-10-09annotate malloc-ish functions卜部昌平
Make them gcc friendly. Note that realloc canot be __malloc__ attributed, according to the GCC manual. Notes: Merged: https://github.com/ruby/ruby/pull/2540
2019-10-09fix arity mismatch卜部昌平
Seems nobody has actually used this macro. Such an obvious typo. Notes: Merged: https://github.com/ruby/ruby/pull/2540
2019-10-09* 2019-10-09 [ci skip]git
2019-10-09lldb_cruby.py: fixed inspecting string [ci skip]Nobuyoshi Nakada
Show the size of String. To see the whole contents even after NUL char: ``` (lldb) rp str (const char [5]) $1 = "x" (lldb) memory read -s1 --format x --count `sizeof($1)` -- &$1 0x1010457a8: 0x78 0x00 0x61 0x61 0x61 ```
2019-10-09lldb_cruby.py: fixed embedded string ptr [ci skip]Nobuyoshi Nakada
Use GetLocation to get the address of embedded array.
2019-10-08Check for invalid hex escapes in URI#query=Jeremy Evans
Fixes [Bug #11275] Notes: Merged: https://github.com/ruby/ruby/pull/2535
2019-10-08Packed delayed token elementsNobuyoshi Nakada
2019-10-08more use of RbConfig::LIMITS卜部昌平
`8 * RbConfig::SIZEOF` ... is not straight.
2019-10-08Import changes from ruby/bigdecimal (#2531)Kenta Murata
Sync to ruby/bigdecimal@92356ba71c6bd325b0ab618c634a7aecf8cdc767 Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2019-10-07Add section to extension.rdoc for backwards compatibility macros [ci skip]Jeremy Evans
These macros should make it easier to C extensions to switch to the Ruby 2.7 C-API *_kw functions, but still have the code work correctly on older Ruby versions.
2019-10-07Note RB_PASS_EMPTY_KEYWORDS and RB_SCAN_ARGS_EMPTY_KEYWORDS will be removedJeremy Evans
There is no need for these in Ruby 3.0, and the plan is to remove them.
2019-10-07Update NEWS with Module#ruby2_keywords and a few other thingsJeremy Evans
2019-10-07Do not free too many pages.Aaron Patterson
Sweep step checks `heap_pages_freeable_pages`, so compaction should do the same.
2019-10-07Move empty pages to the tombAaron Patterson
I think we need to be moving empty pages to the tomb after they become empty.
2019-10-07Eliminate second GC pass for eliminating T_MOVEDAaron Patterson
`T_MOVED` is a linked list, so we can just iterate through the `T_MOVED` objects, clearing them out and adding them to respective free lists.
2019-10-08* 2019-10-08 [ci skip]git
2019-10-08Fix typo [ci skip]Kazuhiro NISHIYAMA
pointed out by ruby-trunk-changes
2019-10-07Allow ruby2_keywords to be used with bmethodsJeremy Evans
There are libraries that use define_method with argument splats where they would like to pass keywords through the method. To more easily allow such libraries to use ruby2_keywords to handle backwards compatibility, it is necessary for ruby2_keywords to support bmethods. Notes: Merged: https://github.com/ruby/ruby/pull/2532
2019-10-07Write yaml and json under destdir and print to stdoutKazuhiro NISHIYAMA
2019-10-07Create info.yml and info.jsonKazuhiro NISHIYAMA
- `info.yml` is for ruby/www.ruby-lang.org/_data/releases.yml - `info.json` is meta data for users of snapshot
2019-10-07Remove `-s3` optionKazuhiro NISHIYAMA
It will not use in `ruby/actions`, and `default=tmp` is not correct.
2019-10-07Version 0.0.3aycabta
2019-10-07Add: Array#intersection methodPrajjwal Singh
Notes: Merged: https://github.com/ruby/ruby/pull/2533
2019-10-07* 2019-10-07 [ci skip]git
2019-10-07Flush console just after printingaycabta
2019-10-07Use built-in Win32API on JRubyaycabta
It's fixed for JRuby dedicatedly.
2019-10-07Swap expected and actual correctlyaycabta
2019-10-06Revert "tailcall optimization again (#2528)"Koichi Sasada
This reverts commit f62f90367fc3bce6714e7c34cbd040e14e43fe07.
2019-10-06tailcall optimization again (#2528)wanabe
This is follow up of r67315.
2019-10-06test/dtrace/helper.rb: Etc.getgrnam may return nil on some platformsYusuke Endoh
2019-10-06* 2019-10-06 [ci skip]git
2019-10-06time.c: Fix some bugs about WIDEVALUEYusuke Endoh
WIDEVALUE differs from VALUE in 32bit platform, but some codes assume that they are the same. There is `#define STRUCT_WIDEVAL` mode to check the consistency. This change allows to build with STRUCT_WIDEVAL.
2019-10-05ext/openssl/ossl_ssl.c: Use const declaration if LibreSSL >= 2.8.0Yusuke Endoh
to suppress a warning in OpenBSD. ``` ossl_ssl.c:938:31: warning: incompatible pointer types passing 'SSL_SESSION *(SSL *, unsigned char *, int, int *)' (aka 'struct ssl_session_st *(struct ssl_st *, unsigned char *, int, int *)') to parameter of type 'SSL_SESSION *(*)(struct ssl_st *, const unsigned char *, int, int *)' (aka 'struct ssl_session_st *(*)(struct ssl_st *, const unsigned char *, int, int *)') [-Wincompatible-pointer-types] SSL_CTX_sess_set_get_cb(ctx, ossl_sslctx_session_get_cb); ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/ssl.h:738:20: note: passing argument to parameter 'get_session_cb' here SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, ^ 1 warning generated. ```
2019-10-05ext/json/parser/prereq.mk: use `if $. == 1` instead of a hacky codeYusuke Endoh