Граф коммитов

7315 Коммитов

Автор SHA1 Сообщение Дата
git c07165be1d * expand tabs. 2019-07-03 02:13:25 +09:00
Nobuyoshi Nakada bdddaa9f56
Use rb_ident_hash_new instead of rb_hash_new_compare_by_id
The latter is same as the former, removed the duplicate function.
2019-07-03 02:09:01 +09:00
Nobuyoshi Nakada 99dc885974
Fixed inadvertent ID creation in rb_iv_get 2019-07-01 13:56:55 +09:00
Nobuyoshi Nakada 7b716bc52a
Show the parser states in pretty_print too 2019-06-27 16:58:06 +09:00
Jean Boussier 746812ee96 Do not allocate a string to check if a scalar is an integer 2019-06-25 15:56:20 +09:00
Jean Boussier 5a4d2b9f2f Remove string_cache in ScalarScanner 2019-06-25 15:56:20 +09:00
Jean Boussier 63f78bbaae Reduce string allocations in scalar_scanner 2019-06-25 15:56:20 +09:00
SHIBATA Hiroshi 00d0ede845 Removed CHANGELOG from rdoc files. 2019-06-25 15:56:20 +09:00
SHIBATA Hiroshi 3c4fc830dd Retired to write CHANGELOG.rdoc. Because It has no update from 2015. 2019-06-25 15:56:20 +09:00
Aaron Patterson 03dac55f90 Dump Hash ivars before elements
When the Hash is revived, the ivars will be set before elements.  This
is for the case when the hash setter depends on ivars set on the hash.
2019-06-25 15:56:20 +09:00
Aaron Patterson a53ab897c3 Round trip exception backtraces
This commit allows exception backtraces to round trip
2019-06-25 15:56:20 +09:00
Aaron Patterson f770a5be66 Refactor exception dumping 2019-06-25 15:56:20 +09:00
Aaron Patterson 4bd1909427 Dumping the backtrace never worked, so remove it
Dumping the backtrace for exceptions never worked, so lets remove it.
2019-06-25 15:56:20 +09:00
Samuel Williams d17344cfc5 Remove IA64 support. 2019-06-19 23:30:04 +12:00
Hiroshi SHIBATA 40f8c82b96 Partly revert directory structure for cparse.
It break the some build environment.
2019-06-19 18:35:44 +09:00
Hiroshi SHIBATA e892c2f924 Restore ruby/ruby change for extconf.rb. 2019-06-19 18:18:08 +09:00
Hiroshi SHIBATA 1a2546c2be Backport racc-1.4.15 from upstream. 2019-06-19 18:17:25 +09:00
Nobuyoshi Nakada 801d0d9dd7
Support Bison 3 in ripper 2019-06-17 23:25:47 +09:00
Nobuyoshi Nakada 6fa4c90448
Prefer `enum yytokentype` to int 2019-06-15 11:58:02 +09:00
Nobuyoshi Nakada f169043d81
Add pipeline operator [Feature #15799] 2019-06-13 18:44:32 +09:00
Nobuyoshi Nakada 9593e76ac2
Ripper::Lexer: fallback parse error token to the previous one 2019-06-12 15:25:06 +09:00
git fe9701ee00 * expand tabs. 2019-06-11 06:56:46 +09:00
Yusuke Endoh de4b2930f7 ext/socket/ipsocket.c: Use SO_REUSEADDR for local_host/port
Sometimes ruby/spec fails when trying to specify local_host and
local_port for TCPSocket.open.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190610T192504Z.fail.html.gz
2019-06-11 06:53:33 +09:00
Nobuyoshi Nakada 2bc09665ab
win32/registry.rb: fix potential infinite loop
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_value):
  advance the index even if an error occurred in #read.
2019-06-07 02:00:48 +09:00
Takashi Kokubun 0a29dc87e6
Optimize CGI.escapeHTML by reducing buffer extension
and switch-case branches.

Buffer allocation optimization using `ALLOCA_N` would be the main
benefit of patch. It eliminates the O(N) buffer extensions.

It also reduces the number of branches using escape table like
https://mattn.kaoriya.net/software/lang/c/20160817011915.htm.

Closes: https://github.com/ruby/ruby/pull/2226

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
2019-06-05 21:07:04 +09:00
git 6b66a76f43 * expand tabs. 2019-06-05 11:01:59 +09:00
Takashi Kokubun 71b14affc6
Revert "Optimize CGI.escapeHTML by reducing buffer extension"
This reverts commit 8d81e59aa7.

`ALLOCA_N` does not check stack overflow unlike ALLOCV. I'll fix it and
re-commit it again.
2019-06-05 11:00:54 +09:00
Takashi Kokubun 8d81e59aa7
Optimize CGI.escapeHTML by reducing buffer extension
and switch-case branches.

Buffer allocation optimization using `ALLOCA_N` would be the main
benefit of patch. It eliminates the O(N) buffer extensions.

It also reduces the number of branches using escape table like
https://mattn.kaoriya.net/software/lang/c/20160817011915.htm.

Closes: https://github.com/ruby/ruby/pull/2226

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
2019-06-05 10:08:55 +09:00
Jeremy Evans 06a25344d9 Make psych.so deterministic
Fixes Ruby Bug #15890
2019-06-02 07:59:56 +03:00
Nobuyoshi Nakada b0e2b7a5ff
Include stack elements left after errors 2019-05-30 21:54:38 +09:00
Nobuyoshi Nakada 5ceff480c2
ripper: Ripper::Lexer#scan
* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer#scan): parses the
  code and returns the result elements including errors.
  [EXPERIMENTAL]
2019-05-29 18:21:28 +09:00
Nobuyoshi Nakada 72333286c4
Fix typos in Ripper::Lexer#inspect and Ripper::Lexer#pretty_print 2019-05-28 11:38:13 +09:00
Nobuyoshi Nakada af17e111b3
Added #inspect and #pretty_inspect to Ripper::Lexer::Elem 2019-05-27 13:58:40 +09:00
Nobuyoshi Nakada fe3ff5afb0
Suppress paranoid warnings for external/3rd-party libraries
[Feature #15665]
2019-05-23 17:36:26 +09:00
Nobuyoshi Nakada a829be209f
Ripper: no documents of fallback methods 2019-05-22 08:57:20 +09:00
Nobuyoshi Nakada 214e2f93aa
Fix the warning in 456586bb23 2019-05-15 18:19:23 +09:00
Nobuyoshi Nakada 29dde62605
io/console: rb_str_cat_conv_enc_opts is not exported 2019-05-14 14:50:21 +09:00
Nobuyoshi Nakada c174670823
io/console: fix up timeout on Windows 2019-05-14 14:39:08 +09:00
Nobuyoshi Nakada 456586bb23
io/console: support getch timeout on Windows 2019-05-14 14:21:46 +09:00
Nobuyoshi Nakada 6d733565c2
io/console: support wide character input on Windows 2019-05-14 14:20:09 +09:00
Aaron Patterson 79ead821dd
Add NaN / Infinity / MinusInfinity to mark list
This prevents the constants from moving.
2019-05-13 14:27:54 -07:00
Nobuyoshi Nakada 3b3b4a44e5
Update dependencies 2019-05-13 23:53:46 +09:00
Hiroshi SHIBATA 082bbdc92e Update the canonical repository for racc. 2019-05-13 21:26:13 +09:00
Alan Wu c06ddfee87
str_duplicate: Don't share with a frozen shared string
This is a follow up for 3f9562015e.
Before this commit, it was possible to create a shared string which
shares with another shared string by passing a frozen shared string
to `str_duplicate`.

Such string looks like:

```
 --------                    -----------------
 | root | ------ owns -----> | root's buffer |
 --------                    -----------------
     ^                             ^   ^
 -----------                       |   |
 | shared1 | ------ references -----   |
 -----------                           |
     ^                                 |
 -----------                           |
 | shared2 | ------ references ---------
 -----------
```

This is bad news because `rb_fstring(shared2)` can make `shared1`
independent, which severs the reference from `shared1` to `root`:

```c
/* from fstr_update_callback() */
str = str_new_frozen(rb_cString, shared2);  /* can return shared1 */
if (STR_SHARED_P(str)) { /* shared1 is also a shared string */
    str_make_independent(str);  /* no frozen check */
}
```

If `shared1` was the only reference to `root`, then `root` can be
reclaimed by the GC, leaving `shared2` in a corrupted state:

```
 -----------                         --------------------
 | shared1 | -------- owns --------> | shared1's buffer |
 -----------                         --------------------
      ^
      |
 -----------                         -------------------------
 | shared2 | ------ references ----> | root's buffer (freed) |
 -----------                         -------------------------
```

Here is a reproduction script for the situation this commit fixes.

```ruby
a = ('a' * 24).strip.freeze.strip
-a
p a
4.times { GC.start }
p a
```

 - string.c (str_duplicate): always share with the root string when
   the original is a shared string.
 - test_rb_str_dup.rb: specifically test `rb_str_dup` to make
   sure it does not try to share with a shared string.

[Bug #15792]

Closes: https://github.com/ruby/ruby/pull/2159
2019-05-09 10:04:19 +09:00
Hiroshi SHIBATA 45b125eca7
Update the canonical repository url. 2019-05-07 23:16:26 +09:00
Aaron Patterson 19d454a957
syntax error can move, so do not cache 2019-04-23 15:26:21 -07:00
git e50e60b96a * expand tabs. 2019-04-23 12:34:10 +09:00
Aaron Patterson 5a58318a90
T_MOVED can live on the stack, so make sure we can do book keeping
Unused T_MOVED objects can live on the stack, so we need to make sure
that they can be accounted for in book keeping
2019-04-22 20:33:16 -07:00
tenderlove 91793b8967 Add `GC.compact` again.
🙏

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20 01:19:47 +00:00
tenderlove 744e5df715 Reverting compaction for now
For some reason symbols (or classes) are being overridden in trunk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 09:41:41 +00:00
svn fc9f19abe8 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 06:48:26 +00:00
ktsj 9738f96fcf Introduce pattern matching [EXPERIMENTAL]
[ruby-core:87945] [Feature #14912]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 06:48:03 +00:00
tenderlove 3c55b643ae Adding `GC.compact` and compacting GC support.
This commit adds the new method `GC.compact` and compacting GC support.
Please see this issue for caveats:

  https://bugs.ruby-lang.org/issues/15626

[Feature #15626]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17 03:17:25 +00:00
mame 82632d4c0c ext/openssl/ossl_bn.c (ossl_bn_initialize): get rid of SEGV
OpenSSL::BN.new(nil, 2) dumped core.

[ruby-core:92231] [Bug #15760]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 12:57:39 +00:00
svn 481481b81a * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 09:16:00 +00:00
kazu 25c1fd3b90 Reverting all commits from r67479 to r67496 because of CI failures
Because hard to specify commits related to r67479 only.
So please commit again.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 09:15:21 +00:00
svn 0cc2ffbc1b * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 08:03:48 +00:00
mame 83fc324d1d ext/openssl/ossl_bn.c (ossl_bn_initialize): get rid of SEGV
OpenSSL::BN.new(nil, 2) dumped core.

[ruby-core:92231] [Bug #15760]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10 08:03:47 +00:00
tenderlove e385c159da Add error globals to mark list so they don't move
JSON gem is referencing constants defined in Ruby then keeping a
reference as a global.  We need to register these globals so they stay
pinned.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09 21:13:32 +00:00
nobu 320c98b436 date: support for Reiwa, new Japanese era
[Feature #15742]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09 01:27:36 +00:00
nobu 63e66f08b6 date_core.c: [DOC] Heisei will be assumed if no-era [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09 01:27:35 +00:00
svn a6146af5bd * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-03 10:56:37 +00:00
nobu 1329c7cdca date: make zone a substring to copy encoding and taintedness
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-03 10:56:36 +00:00
nobu 7cd6706b9a date_parse.c: name JISX0301_DEFAULT_ERA
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-02 04:36:34 +00:00
nobu da0fceae3b date_parse.c: renamed JAPANESE prefix as JISX0301
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-02 04:36:33 +00:00
svn 5f3e5e6fc5 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-02 03:49:00 +00:00
nobu e8f8cf111f date: use del_hash to extract an element destructively
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-02 03:48:58 +00:00
nobu 285817c6d8 date_parse.c: removed 'r' which is not in JIS X 0301 yet
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-01 05:28:25 +00:00
svn e836cd0b9f * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-01 05:21:39 +00:00
nobu 744c314059 date_parse.c: extract Japanese era initials
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-01 05:21:36 +00:00
nobu 12acc751e3 Numbered parameters [Feature #4475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:21:18 +00:00
nobu e5f01dab9d numeric.c: fix infinite loop
* numeric.c (int_pow): fix infinite loop in the case of y equal 1
  and power of x does not overflow.
  [ruby-core:91734] [Bug #15651]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 01:37:16 +00:00
nobu 72df0a8e47 Add ignored_sp event
* ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): add ignored_sp
  event which will be fired from Ripper::Lexer#on_heredoc_dedent
  method.  [ruby-core:91727] [Bug #15648]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-09 10:17:33 +00:00
naruse a679e98e64 Fix PTY.open on OpenBSD [Bug #15607]
From: Jeremy Evans <code@jeremyevans.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-06 09:48:39 +00:00
hsbt 19cf8e0387 Fixed build failure of Travis CI. We need to support `make srcs`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-01 08:31:43 +00:00
hsbt fe61f14d53 Support YACC environment variable for ripper.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-01 03:45:00 +00:00
hsbt 6604e1b7cd Merge json-2.2.0 from flori/json.
https://github.com/flori/json/releases/tag/v2.2.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-23 03:43:58 +00:00
nobu 15a98ab428 Try statx syscall
* file.c (rb_file_s_birthtime): export for pathname to check if
  birthtime is supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-20 06:54:23 +00:00
nobu d1e6304a89 Prefer relative directory from srcdir to top_srcdir
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-14 05:42:14 +00:00
nobu 4844a44940 Suppress a warning
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-13 15:20:50 +00:00
ko1 c6a2de3029 check return value of `write` to suppress warning.
* ext/-test-/gvl/call_without_gvl/call_without_gvl.c (do_loop):
  `-Wunused-result` compiler option (gcc?) checks checking
  return value of `write`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-13 09:40:45 +00:00
svn 698c55d32a * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-13 04:25:00 +00:00
ko1 74b19e330a fix imemo entry description.
* ext/objspace/objspace.c (count_imemo_objects): `imemo_type_ids`
  should be match with `enum imemo_type` in internal.h and this
  patch fix mismatch.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-13 04:24:59 +00:00
nobu 63f990674b Use $(hdrdir) for include/ruby.h, as well as r67033
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-11 13:43:14 +00:00
nobu 3d1c86a26f Removed moving toplevel header since r12501
Moving public headers was 12-years ago, no depend files would
expect ruby.h in the top source directory now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-08 02:46:22 +00:00
nobu d7976d1451 Use `&` instead of `modulo`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-15 12:05:46 +00:00
shyouhei d154bec0d5 setbyte / ungetbyte allow out-of-range integers
* string.c: String#setbyte to accept arbitrary integers [Bug #15460]

* io.c: ditto for IO#ungetbyte

* ext/strringio/stringio.c: ditto for StringIO#ungetbyte



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-15 06:41:58 +00:00
svn df0faba1ff * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 12:55:21 +00:00
kazu 730f2886b5 Follow behaviour of IO#ungetbyte
see r65802 and [Bug #14359]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-09 12:55:20 +00:00
hsbt da1f9199bd Bump version to date-2.0.0.
I forgot to change it when Ruby 2.6.0 was released.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-07 06:01:49 +00:00
normal 23444302d9 introduce rb_nogvl C-API to mark ubf as async-signal-safe
zlib and bignum both contain unblocking functions which are
async-signal-safe and do not require spawning additional
threads.

We can execute those functions directly in signal handlers
without incurring overhead of extra threads, so provide C-API
users the ability to deal with that.  Other C-API users may
have similar need.

This flexible API can supercede existing uses of
rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by
introducing a flags argument to control behavior.

Note: this API is NOT finalized.  It needs approval from other
committers.  I prefer shorter name than previous
rb_thread_call_without_gvl* functions because my eyes requires
big fonts.

[Bug #15499]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:14:11 +00:00
svn d935a0ab95 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31 15:00:52 +00:00
nobu 67c5747369 Method reference operator
Introduce the new operator for method reference, `.:`.
[Feature #12125] [Feature #13581]
[EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31 15:00:37 +00:00
nobu 1bdd422b93 Fix indents [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31 14:59:29 +00:00
nobu 384ca22a7a io-console.gemspec: update
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-27 04:21:53 +00:00
mrkn 35b7af7503 Import bigdecimal 1.4.2
* https://github.com/ruby/bigdecimal/compare/v1.4.1..v1.4.2

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-26 08:17:30 +00:00
nobu d880245cbc io-console: bump to 0.4.7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-25 03:24:31 +00:00
mrkn 1bcc76338d Import bigdecimal 1.4.1
* https://github.com/ruby/bigdecimal/compare/v1.4.0..v1.4.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-25 01:17:59 +00:00
mrkn 8754b2391b Import bigdecimal-1.4.0
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181220a..v1.4.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-23 18:32:01 +00:00
k0kubun c1b8965410 ../arith_seq/../extract.c: remove unused variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-21 16:19:31 +00:00
mrkn ccdba542d3 Import bigdecimal-1.4.0.pre.20181220a
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181214a..v1.4.0.pre.20181220a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20 23:29:49 +00:00
mame ab2da43ce4 ext/coverage/lib/coverage.rb (Coverage.line_stub): use only line events
It wrongly used all linenos of ISeq#trace_points which includes not only
line events but also call, return, and other events.  So, the result
included some linenos that can not be covered at all by line coverage.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20 10:17:37 +00:00
akr 78dc3da299 Pathname#relative_path_from uses is_a?
I reconsidered because simpler code would have better maintainablity.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-18 03:09:54 +00:00
hsbt 623c6d972a Bump version to psych 3.1.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-18 02:01:39 +00:00
akr 4cf828632f Pathname#relative_path_from compatible with mock.
[Fix GH-2049]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-16 12:26:52 +00:00
k0kubun c3641d5b24 Revert "* expand tabs."
This reverts commit 298180f045.

It looks like we should not expand ext/nkf:
https://git.ruby-lang.org/ruby-commit-hook.git/commit/?id=91fd9708b7cf04a4dcddd9614c24e27ddef5d43b

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-15 14:45:36 +00:00
svn 298180f045 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-15 09:55:26 +00:00
naruse 96b32a0108 Merge nkf v2.1.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-15 09:55:24 +00:00
nobu cbcc148eaf Suppress deprecation warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-14 04:10:42 +00:00
mrkn 62b55d9483 Import bigdecimal-1.4.0.pre.20181214a
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181205a..v1.4.0.pre.20181214a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-14 03:33:53 +00:00
nobu 21d99677f6 Separate RSTRING_PTR from a function call
Do not apply RSTRING_PTR, a macro which evaluats its argument
multiple times, on a function call.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-13 05:09:58 +00:00
mrkn 68bdef0041 Add test cases of rb_arithmetic_sequence_extract
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 21:17:04 +00:00
nobu c1534d206d Revise Date#hour, #min, #sec
For ActiveSupport.  [ruby-core:90443] [Bug #15403]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 11:43:14 +00:00
nobu 241dced625 Disable tailcall optimization [Bug #15303]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 05:46:13 +00:00
akr 53a5b276b8 Use File class methods to avoid pipe execution
Following methods use corresponding File class methods
instead of IO class methods.

- Pathname#each_line
- Pathname#read
- Pathname#binread
- Pathname#write
- Pathname#binwrite
- Pathname#readlines

Reported by ooooooo_q.





git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 05:07:49 +00:00
nobu 1a0e374b33 ext/date: Fix !NDEBUG code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-11 05:09:34 +00:00
nobu b572705486 date_core.c: moved some methods to DateTime
* ext/date/date_core.c (Init_date_core): moved methods which make
  sense only for DateTime to that class, instead of defining
  private methods in Date and making them public in DateTime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-11 04:35:13 +00:00
nobu 73400c01f7 date_core.c: reorder ComplexDateData
* ext/date/date_core.c (ComplexDateData): reordered to adjust
  common part with SimpleDateData.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-11 04:30:31 +00:00
normal cc9b57a2b4 zlib (gzfile_write_raw): do not resize string after .write call
Apparently, a component of Rails implements a buffering .write
method which keeps the String buffer around and makes it unsafe
for us to clear it after calling .write.

This caused Rack::Deflater to give empty results when enabled.

Fortunately, per r61631 / a55abcc0ca,
this misguided optimization was only worth a small (0.5MB) savings
and we still benefit from the majority of the memory savings in
that change.

Thanks to zunda for the bug report.

[ruby-core:90133] [Bug #15356]

Fixes: r61631 (commit a55abcc0ca)
       ("zlib: reduce garbage on gzip writes (deflate)")

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-07 07:09:31 +00:00
mrkn 2810c12a99 Import bigdecimal 1.4.0.pre.20181205a
* https://github.com/ruby/bigdecimal/compare/74d25ef..v1.4.0.pre.20181205a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05 11:30:24 +00:00
mrkn f15cf0918a Revert bigdecimal 1.4.0 related commits
* Revert "Remove unnecessary linker flags"

  This reverts commit 49efa01579.

* Revert "Move dependency on gemspec"

  This reverts commit bfb64d4765.

* Revert "Remove unnecessary directory listing"

  This reverts commit 86661b5c60.

* Revert "* expand tabs."

  This reverts commit 35ada33f83.

* Revert "Import bigdecimal-1.4.0.pre-20181204a"

  This reverts commit 8891bb3bd6.

* Revert "ext/bigdecimal/bigdecimal.c: drop unused function"

  This reverts commit 5ceeea4da1.

* Revert "* expand tabs."

  This reverts commit e021386e90.

* Revert "Import bigdecimal-1.4.0.pre-20181130a"

  This reverts commit a0e438cd3c.

* Revert "NEWS: write about bigdecimal updates"

  This reverts commit 89455ff2ba.

* Revert "Fix rubyspec of bigdecimal for ruby <2.6"

  This reverts commit 4bcdeeb65e.

* Revert "Fix rubyspec against bigdecimal updates"

  This reverts commit c8fb30fc9e.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05 04:01:53 +00:00
hsbt 631086b784 Merge upstream from ruby/psych
* https://github.com/ruby/psych/pull/379

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 12:24:12 +00:00
nobu 49efa01579 Remove unnecessary linker flags
Cygwin/mingw linker should be able to link against shared library
itself.  Mswin build sets -def:$(DEFFILE) option by the default.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 11:16:15 +00:00
nobu bfb64d4765 Move dependency on gemspec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 11:16:14 +00:00
nobu 86661b5c60 Remove unnecessary directory listing
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 11:16:11 +00:00
kazu c01a5ee85e Use delete_prefix instead of `sub(/\Afixed-pattern/, '')`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 08:22:10 +00:00
svn 35ada33f83 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 04:22:12 +00:00
mrkn 8891bb3bd6 Import bigdecimal-1.4.0.pre-20181204a
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181130a..v1.4.0.pre.20181204a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04 04:22:09 +00:00
k0kubun 5ceeea4da1 ext/bigdecimal/bigdecimal.c: drop unused function
This has been unused since r66124.

cc: @mrkn

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-03 12:39:11 +00:00
mrkn a7e3516ff1 Fix JSON::Parser against bigdecimal updates
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:57 +00:00
svn e021386e90 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:57 +00:00
mrkn a0e438cd3c Import bigdecimal-1.4.0.pre-20181130a
* https://github.com/ruby/bigdecimal/compare/74d25ef..v1.4.0.pre.20181130a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:54 +00:00
mrkn 5cae104e51 Let sub-directory exts depend on their parent ext
* ext/extmk.rb: Let sub-directory exts depend on their parent ext.

* template/exts.mk.tmpl: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-01 09:29:14 +00:00
normal 9d74d402e1 disable non-blocking pipes and sockets by default
There seems to be a compatibility problems with Rails +
Rack::Deflater; so we revert this incompatibility.

This effectively reverts r65922; but keeps the bugfixes to
better support non-blocking sockets and pipes for future use.

[Bug #15356] [Bug #14968]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-29 20:00:00 +00:00
hsbt b52761e4f7 Merge stringio.gemspec from github repository.
Temporary ignored configuration of certificate sign.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-28 02:38:29 +00:00
normal 0698c4969c socket: disable nonblocking-by-default on win32
Perhaps this fixes test failures reported by Greg and k0kubun.

However, the failure of certain tests to handle non-blocking I/O
seems to indicate pre-existing problems on win32 platforms.
Somebody knowledgeable about win32 should be able to fix it.

[ruby-core:89973] [ruby-core:89976] [ruby-core:89977] [Bug #14968]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22 20:02:36 +00:00
normal 0bd8193eba ext/socket/init.c (rsock_socket0): non-blocking for non-SOCK_NONBLOCK
We need to make sockets non-blocking for systems without
SOCK_CLOEXEC/SOCK_NONBLOCK macros at all.

[ruby-core:89965] [Bug #14968]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22 10:13:21 +00:00
normal 6a65f2b1e4 io + socket: make pipes and sockets nonblocking by default
All normal Ruby IO methods (IO#read, IO#gets, IO#write, ...) are
all capable of appearing to be "blocking" when presented with a
file description with the O_NONBLOCK flag set; so there is
little risk of incompatibility within Ruby-using programs.

The biggest compatibility risk is when spawning external
programs.  As a result, stdin, stdout, and stderr are now always
made blocking before exec-family calls.

This change will make an event-oriented MJIT usable if it is
waiting on pipes on POSIX_like platforms.

It is ALSO necessary to take advantage of (proposed lightweight
concurrency (aka "auto-Fiber") or any similar proposal for
network concurrency: https://bugs.ruby-lang.org/issues/13618

Named-pipe (FIFO) are NOT yet non-blocking by default since
they are rarely-used and may introduce compatibility problems
and extra syscall overhead for a common path.

Please revert this commit if there are problems and if I am afk
since I am afk a lot, lately.

[ruby-core:89950] [Bug #14968]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22 08:46:51 +00:00
odaira 3385395796 errno.h must be included after config.h because config.h might define
_REENTRANT, _THREAD_SAFE, etc., which affect how errno is defined
on some architectures

* ext/openssl/ossl.h: include errno.h after ruby.h

* include/ruby/io.h: include errno.h after ruby/config.h

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 20:39:09 +00:00
k0kubun cb153527c4 [doc] Fix grammar typo in Pty_init() docstring [ci skip]
[Fix GH-2014]

From: Olle Jonsson <olle.jonsson@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-16 04:25:07 +00:00
marcandre dde0e30c2d Pathname: Have #relative_path_from accept String argument.
[Fix GH-1975]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 06:20:06 +00:00
nobu 3d5be5f86a date_core.c: use static ID variables
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 04:51:46 +00:00
nobu 93f91eb68f date_core.c: obey to the allocation framework
* ext/date/date_core.c (date_initialize): separate from
  date_s_civil and obey the allocation framework.

* ext/date/date_core.c (datetime_initialize): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 04:29:32 +00:00
nobu 0fa71d44d5 date_core.c: respect COMPLEX_DAT bit
* ext/date/date_core.c (d_lite_marshal_load): respect COMPLEX_DAT
  bit in the pre-allocated structure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 04:29:31 +00:00
nobu 8655d0735f date_core.c: keep COMPLEX_DAT bit
* ext/date/date_core.c (d_lite_initialize_copy): do not change
  COMPLEX_DAT bit, as the structure does not change.  initialize
  member-wise instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 04:29:30 +00:00
nobu 53ad55e4ca date_core.c: set/reset COMPLEX_DAT
* ext/date/date_core.c (set_to_simple, set_to_complex): always
  set/reset COMPLEX_DAT bit, which is very tightly bound to the
  structure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 04:29:29 +00:00
nobu afa1c6a2df Use friendlier terminology in rubysocket.h comment
[Fix GH-2008]

From: Juanito Fatas <juanito.fatas@shopify.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-11 00:46:31 +00:00
nobu 06b6313030 Revert "Use friendlier terminology in rubysocket.h comment"
This reverts commit dcd41bbbdb021b5e0e74f8a33c2c58cecf595f29.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-11 00:46:30 +00:00
nobu 51fbedddf1 Use friendlier terminology in rubysocket.h comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-11 00:40:25 +00:00
nobu 6268098208 Make rubygems follow the upstream of psych
And merge psych again.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-11 00:20:27 +00:00
mame ba8d27e670 Revert "Merge psych from upstream."
This reverts commit db3101ff30.

This caused build error: http://ci.rvm.jp/results/trunk-test@ruby-sky3/1452708

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-10 22:26:37 +00:00
hsbt db3101ff30 Merge psych from upstream.
* https://github.com/ruby/psych/pull/378

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-10 18:06:51 +00:00
normal 86dca76ef2 ext/socket/init.c (wait_connectable): bail out early on some errors
This becomes necesary if sockets become non-blocking by
default <https://bugs.ruby-lang.org/issues/14968>; but it's
always been possible to make sockets non-blocking anyways.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08 03:27:16 +00:00
kazu f83b08755d Fix call-seq of OpenSSL.fips_mode and WIN32OLE_METHOD#name [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-01 07:25:50 +00:00
hsbt b891d95e85 Removed control characters from gemspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-31 00:13:56 +00:00
ko1 8f675cdd00 support theap for T_HASH. [Feature #14989]
* hash.c, internal.h: support theap for small Hash.
  Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
  (<=8 entries) are managed by an array data structure.
  This array data can be managed by theap.
  If st_table is needed, then converting array data to st_table data.

  For st_table using code, we prepare "stlike" APIs which accepts hash value
  and are very similar to st_ APIs.

  This work is based on the GSoC achievement
  by tacinight <tacingiht@gmail.com> and refined by ko1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 22:11:51 +00:00
hsbt 3dc960deab Merge stringio.gemspec from github repository.
It fixed the wrong paths of libraries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 00:32:16 +00:00
hsbt e05e77fd6d Retry r65211.
* Maybe, RbConfig.ruby only provides after Ruby installation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 10:30:42 +00:00
hsbt f16326fdda Revert "Mergr etc from github repository."
This reverts commit a852002779.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 10:05:05 +00:00
tadd b640b21d9c fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 07:40:45 +00:00
hsbt a852002779 Mergr etc from github repository.
* ext/etc/extconf.rb: It supports to generate dependency header
    on standalone gem with github repository.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 07:38:19 +00:00
hsbt d303a2c45a Merge fiddle from github repository.
* ext/fiddle/extconf.rb: It supports to build libffi with standalone gem.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 07:27:18 +00:00
svn 8076601976 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 05:33:13 +00:00
mame 47ea999b46 ext/coverage/: add the oneshot mode
This patch introduces "oneshot_lines" mode for `Coverage.start`, which
checks "whether each line was executed at least once or not", instead of
"how many times each line was executed".  A hook for each line is fired
at most once, and after it is fired, the hook flag was removed; it runs
with zero overhead.

See [Feature #15022] in detail.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 05:33:04 +00:00
hsbt 1c92766bf0 Merge Pysch-3.1.0.pre2 from ruby/psych.
* Added deprecated warnings for the new interface of keyword argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 04:25:04 +00:00
nobu fd360dd93a zlib: fix Zlib::VERSION
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18 00:55:05 +00:00
rhe 93bc102727 openssl: sync with upstream repository
Import current master (01b23fa8eee2) of ruby/openssl.git.

----------------------------------------------------------------
Kazuki Yamaguchi (3):
      x509name: fix OpenSSL::X509::Name#{cmp,<=>}
      Ruby/OpenSSL 2.0.9
      Ruby/OpenSSL 2.1.2

nobu (2):
      needs openssl/opensslv.h
      Remove -Wno-parentheses flag.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18 00:24:49 +00:00
stomar 08d01949bf readline.c: improve docs
* ext/readline/readline.c: [DOC] fix typo in docs for
  Readline.completion_quote_character; enable link to method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-12 20:37:30 +00:00
svn 50281e8ca3 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-10 04:24:11 +00:00
ko1 228fc417ce revisit `RARRAY_PTR()`.
* ext/fiddle/function.c (initialize): use RARRAY_AREF() instead of
  using RARRAY_PTR().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-10 04:24:10 +00:00
nobu 97fffcadcb ext/objspace/objspace_dump.c: print addresses consistently
The format addresses are printed in are different if you use
`ObjectSpace.dump_all(output: :stdout)` vs.
`ObjectSpace.dump_all(output: :string)` (or `ObjectSpace.dump`) due to
differences in the underlying `vfprintf` implementation.

Use `"%#"PRIxVALUE` to format `VALUE`.

Co-authored-by: Ashe Connor <ashe@kivikakk.ee>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09 03:21:57 +00:00
svn e20ac9442d * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09 02:01:56 +00:00
naruse b9d00698c8 Revert "ext/objspace/objspace_dump.c: print addresses consistently"
This reverts commit r64970.

Visual C++ 12.0 doesn't have PRIxPTR.
Anyway we have our own vfprintf implementation BSD_vfprintf().
If you want to have portable vfprintf, replace it with BSD_vfprintf like
vsnprintf or just use BSD_vfprintf.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-09 02:01:54 +00:00
svn 9f81048b45 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08 23:43:48 +00:00
tenderlove c5768e4366 ext/objspace/objspace_dump.c: print addresses consistently
The format addresses are printed in are different if you use
`ObjectSpace.dump_all(output: :stdout)` vs.
`ObjectSpace.dump_all(output: :string)` (or `ObjectSpace.dump`) due to
differences in the underlying `vfprintf` implementation.

Use %"PRIxPTR" instead to be consistent across both.

Co-authored-by: Ashe Connor <ashe@kivikakk.ee>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-08 23:43:45 +00:00
nobu 7f24188afe Added missing declarations in readline.h bundled with macOS 10.14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-07 09:17:59 +00:00
suke 22de2030c5 * ext/win32ole/lib/win32ole.rb (methods): COM method elements should be
symbol in return value of methods.

* test/win32ole/test_win32ole.rb ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-26 09:33:46 +00:00
nobu 0d95805c2e Suppress more -Wparentheses warnings
[Fix GH-1958]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 10:31:11 +00:00
svn 2def52500f * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 10:19:14 +00:00
nobu 7e9ee35fb8 Remove -Wno-parentheses flag.
[Fix GH-1958]

From: Jun Aruga <jaruga@redhat.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 10:19:10 +00:00
nobu 742df62eb7 pty.c: typo
* ext/pty/pty.c (chfunc): fix a typo of an operator.  pointed out by
  jaruga (Jun Aruga) at [ruby-core:89058].  [Bug #15116]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-18 09:15:46 +00:00
nobu eddd630047 pty.c: more difensive
* ext/pty/pty.c (chfunc): should not close the slave fd if it is 0..2.
  [ruby-core:89043] [Bug #15116]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-18 00:22:04 +00:00
nobu 3c08f50770 ext/objspace/object_tracing.c (freeobj_i): fix missing assignment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07 14:37:19 +00:00
nobu 164a93c8b7 object_tracing.c: register TracePoint objects
* ext/objspace/object_tracing.c (trace_object_allocations_start): to
  prevent TracePoint objects from GC, register them in the VM, since
  they are unique per VM.
  http://ci.rvm.jp/results/trunk-test@ruby-sky3/1291901

* ext/objspace/object_tracing.c (trace_object_allocations_stop): reuse
  TracePoint objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07 08:28:57 +00:00
nobu 8eb96c6137 ext/objspace/object_tracing.c (freeobj_i): no lookup before delete
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07 03:23:25 +00:00
nobu 4ff0ce6a79 ext/objspace/object_tracing.c: get rid of aliasing pointers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-07 03:16:12 +00:00
nobu 4204eacf0d fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-05 21:34:44 +00:00
naruse 21ce539f20 fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-05 13:16:03 +00:00
naruse 24418e0c77 AIX doesn't set OptionLength for boolean options
https://rubyci.org/logs/rubyci.s3.amazonaws.com/aix71_ppc/ruby-trunk/log/20180904T103302Z.fail.html.gz
https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_72/com.ibm.aix.commtrf2/getsockopt.htm

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-05 13:15:41 +00:00
nobu 074f1c9133 Readline: expose rl_completion_quote_character variable
[Feature #13050]

From: georgebrock (George Brocklehurst) <ruby@georgebrock.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-02 23:27:08 +00:00
kazu 9563db5eb1 Re-try to add workaround for warnings
```
.../ext/psych/lib/psych/versions.rb:4: warning: already initialized constant Psych::VERSION
.../.ext/common/psych/versions.rb:4: warning: previous definition of VERSION was here
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-01 06:59:36 +00:00
nobu 480a21f435 RSTRING_PTR may not be terminated in the future
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-01 06:19:05 +00:00
nobu 8c90838f7c 10**3 is always 1000
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-01 06:14:07 +00:00
nobu dcd4914b3a adjust indent
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-01 06:14:06 +00:00
nobu c4816a11e4 surround macro block with do/while
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-01 04:09:02 +00:00
kazu 0fc1870f23 Revert "Try to add workaround for warnings"
This reverts commit a5e5cfa3f650d4e78fb50e2df15c102ab56fca3c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-31 15:29:06 +00:00
kazu efa19f9f5a Try to add workaround for warnings
```
.../ext/psych/lib/psych/versions.rb:4: warning: already initialized constant Psych::VERSION
.../.ext/common/psych/versions.rb:4: warning: previous definition of VERSION was here
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-31 15:25:52 +00:00
kazu c3e16351d4 [DOC] leap seconds [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-31 15:05:29 +00:00
hsbt 867581dd75 Merge psych-3.1.0.pre1.
* Update bundled libyaml-0.2.1 from 0.1.7.
    https://github.com/ruby/psych/pull/368
  * Unify Psych's API: To use keyword arguments with method call.
    https://github.com/ruby/psych/pull/358

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-27 00:44:04 +00:00
k0kubun 5bd4283f77 ext/readline/extconf.rb: try using more readline APIs
on MinGW.

[Bug #15020]

From: MSP-Greg <Greg.mpls@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-24 10:25:51 +00:00
kazu b8eb530979 Add more assertions for NotImplementedError of instance method
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-21 14:57:56 +00:00
kazu 0381ec5164 Fix test bug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:50:48 +00:00
nobu 74325360d3 Pathname: Simplified Pathname#mountpoint?
Removed unnecessary comparison in mountpoint?
[Fix GH-1927]

From: John Whitson <john.whitson@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 12:04:24 +00:00
nobu a6cb85524c needs openssl/opensslv.h
* ext/openssl/extconf.rb: LIBRESSL_VERSION_NUMBER is defined in
  openssl/opensslv.h.  fix up r64101.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08 15:36:28 +00:00
rhe a0f292bbcd openssl: sync with upstream repository
Sync with the current tip of master branch, 62436385306c of
ruby/openssl.git. Changes can be found at:

	https://github.com/ruby/openssl/compare/v2.1.1...62436385306c

----------------------------------------------------------------
Brian Cunnie (1):
      Correctly verify abbreviated IPv6 SANs

Janko Marohnić (1):
      Reduce memory allocation when writing to SSLSocket

Jeremy Evans (1):
      Move rb_global_variable call to directly after assignment

Kazuki Yamaguchi (7):
      pkcs7: allow recipient's certificate to be omitted for PKCS7#decrypt
      pkey: resume key generation after interrupt
      tool/ruby-openssl-docker: update to latest versions
      test/test_ssl: fix test failure with TLS 1.3
      test/test_x509name: change script encoding to ASCII-8BIT
      x509name: refactor OpenSSL::X509::Name#to_s
      x509name: fix handling of X509_NAME_{oneline,print_ex}() return value

ahadc (1):
      Update CONTRIBUTING.md

nobu (6):
      no ID cache in Init functions
      search winsock libraries explicitly
      openssl: search winsock
      openssl_missing.h: constified
      reduce LibreSSL warnings
      openssl/buffering.rb: no RS when output

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08 14:13:53 +00:00
hsbt 7d9109f800 Removed needless date attribute from gemspec of default gems.
They are assigned automatically when pushing gem file to rubygems.org.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07 12:02:10 +00:00
hsbt 325d378a1f Removed needless file from gemspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07 11:36:09 +00:00
hsbt 9e5cd30bc1 Add support of Berkeley DB 6.x.
https://github.com/ruby/dbm/pull/3

  Co-authored-by: Yasuhiro KIMURA <>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07 11:18:40 +00:00
eregon e7da0fc34e ext/json/parser/parser.c: do not call rb_str_resize() on Time object
* See https://github.com/flori/json/issues/342

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03 15:11:36 +00:00
eregon bf226a9ac4 Fix missed update of parser source in r62429
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03 15:11:22 +00:00
nobu 01d81d1991 reduce LibreSSL warnings
* ext/openssl/extconf.rb: LibreSSL headers emit "overriding WinCrypt
  defines" warnings if wincrypt.h has been included (except for
  x509.h) on Windows.  get rid of including the header by defining
  NOCRYPT macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-29 08:13:05 +00:00
kazu 14892a26a5 use https:// instead of http://
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 10:00:27 +00:00
nobu 97e05dad7f UNREACHABLE_RETURN
* include/ruby/ruby.h (UNREACHABLE_RETURN): UNREACHABLE at the end
  of non-void functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 05:38:07 +00:00
kazu b22352af91 Remove needless `nacl` check
`nacl` support already removed by https://github.com/ruby/ruby/pull/1726.

[Fix GH-1920]

From: yuuji.yaginuma <yuuji.yaginuma@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-22 10:02:54 +00:00
normal a22232cd93 zlib (rb_gzreader_getc): localize and return cbuf directly
No point in having a long-lived cbuf in "struct gzfile"
since GZFILE_CBUF_CAPA is smaller than RSTRING_EMBED_LEN_MAX
(even on 32-bit).  We can also have rb_econv_convert write
directly to the return value instead of an intermediate buffer.

This brings "struct gzfile" from 264 to 256 bytes on 64-bit
systems to avoid taking an additional cache line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-18 08:16:18 +00:00
kazu 043d22cb6f Fixup r63864
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06 01:53:57 +00:00
nobu 33354d2928 Prefixed reset_leap_second_info
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06 01:40:04 +00:00
nobu 0860921a96 Make a prototype
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 15:20:27 +00:00
naruse 1d74de37e3 ruby tool/update-deps --fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 12:48:45 +00:00
naruse 61d5939c23 Add missing prototype
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 12:22:30 +00:00
naruse 7c87ee8a14 Add missing file
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 11:53:18 +00:00
normal 44fc3d08eb unrevert r63852 but keep SIGCHLD path disabled for win32
Reading win32/win32.c waitpid implementation, maybe waitpid(-1, ...)
on that platform will never conflict with mjit use of waitpid.

In any case, I've added WAITPID_USE_SIGCHLD macro to vm_core.h
so it can be easy for Linux/BSD users to test (hopefully!)
win32-compatible code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 03:02:33 +00:00
naruse df4a126d65 Revert r63758 and related commits
The change is unstable on Windows. Please re-commit it when it correctly
supports Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04 15:08:56 +00:00
normal 054a412d54 hijack SIGCHLD handler for internal use
Use a global SIGCHLD handler to guard all callers of rb_waitpid.
To work safely with multi-threaded programs, we introduce a
VM-wide waitpid_lock to be acquired BEFORE fork/vfork spawns the
process.  This is to be combined with the new ruby_waitpid_locked
function used by mjit.c in a non-Ruby thread.

Ruby-level SIGCHLD handlers registered with Signal.trap(:CHLD)
continues to work as before and there should be no regressions
in any existing use cases.

Splitting the wait queues for PID > 0 and groups (PID <= 0)
ensures we favor PID > 0 callers.

The disabling of SIGCHLD in rb_f_system is longer necessary,
as we use deferred signal handling and no longer make ANY
blocking waitpid syscalls in other threads which could "beat"
the waitpid call made by rb_f_system.

We prevent SIGCHLD from firing in normal Ruby Threads and only
enable it in the timer-thread, to prevent spurious wakeups
from in test/-ext-/gvl/test_last_thread.rb with MJIT enabled.

I've tried to guard as much of the code for RUBY_SIGCHLD==0
using C "if" statements rather than CPP "#if" so to reduce
the likelyhood of portability problems as the compiler will
see more code.

We also work to suppress false-positives from
Process.wait(-1, Process::WNOHANG) to quiets warnings from
spec/ruby/core/process/wait2_spec.rb with MJIT enabled.

Lastly, we must implement rb_grantpt for ext/pty.  We need a
MJIT-compatible way of supporting grantpt(3) which may spawn
the `pt_chown' binary and call waitpid(2) on it.

[ruby-core:87605] [Ruby trunk Bug#14867]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27 03:14:30 +00:00
shyouhei 33d0be1500 comma at the end of enum is a C99ism
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-25 03:14:48 +00:00
normal 8b590c4663 UNIXSocket#recv_io: trigger GC when out of FDs
Make this behavior is consistent with our other FD-allocating
methods.

EMFILE and ENFILE are not documented nor can I trigger them when
using UNIXSocket#recv_io.  However, ENOMEM is documented, and
I've triggered EMSGSIZE on FreeBSD and truncated messages when
an EMFILE condition is hit on my system.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24 22:08:15 +00:00
nobu cc77a81129 openssl_missing.h: constified
* ext/openssl/openssl_missing.h (IMPL_KEY_ACCESSOR{2,3}):
  constified obj argument getters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-17 10:17:39 +00:00
mame 301fa452f7 Remove flip-flop usages from build scripts
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-15 08:53:17 +00:00
yui-knk 46463af983 Define AST module under RubyVM [experimental]
* ext/-test-/ast/ast.c: Rename to ast.c
  and define AST module under RubyVM.
* common.mk: compile ast.c.
* ext/-test-/ast/extconf.rb: Don't need this file anymore.
* inits.c (rb_call_inits): Call Init_ast to setup AST module.
* test/-ext-/ast/test_ast.rb: Follow up the namespace change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-31 06:13:06 +00:00
yui-knk a97d22a004 ast.c: Do not taint TOPLEVEL_BINDING
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-31 05:49:56 +00:00
nobu 162adb82d1 Workaround for old LibreSSL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-30 09:13:21 +00:00
hsbt 1f4796a182 Merge etc gemspec from github repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-28 00:42:32 +00:00
ngoto 26cbe46e68 ext/pty/pty.c: I_FIND before I_PUSH if possible
* ext/pty/pty.c: Check whether each STREAMS module is already pushed
  or not by using I_FIND ioctl call, before pushing it by using I_PUSH.
  Solved test failure on Solaris. On a Solaris 10 machine, ioctl I_PUSH
  "ldterm" twice was the cause of duplicated "\r".
  [Bug #14786] [ruby-dev:50552]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-23 15:58:53 +00:00
normal a687547a9a -test-/wait_for_single_fd: fix -Wformat-security warning
Oops

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-15 01:29:14 +00:00
normal 863e24b2b1 test_wait_for_single_fd: ensure this works with kqueue
Regardless of future features, this needs to work with
kqueue descriptors across platforms.

Today this will be useful for 3rd-party libraries using
kqueue.  In the future, Ruby may use kqueue natively
and we shall ensure we can wait on it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-14 23:51:35 +00:00
rhe 961cbe5262 openssl: merge changes in v2.1.1
Commits in upstream repository since v2.1.0 can be found at:

	https://github.com/ruby/openssl/compare/v2.1.0...v2.1.1

----------------------------------------------------------------
Kazuki Yamaguchi (7):
      test/utils: disable Thread's report_on_exception in start_server
      cipher: validate iterations argument for Cipher#pkcs5_keyivgen
      extconf.rb: fix build with LibreSSL 2.7.0
      test/test_pkey_rsa: fix test failure with OpenSSL 1.1.1
      test/test_ssl_session: set client protocol version explicitly
      Ruby/OpenSSL 2.0.8
      Ruby/OpenSSL 2.1.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-12 07:33:53 +00:00
mame e9303e1a00 Rename imemo_alloc with imemo_tmpbuf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09 07:11:59 +00:00
normal 0e32c7c10a Revert "ext/cgi/escape: preserve String subclass in result"
This reverts commit 6afea14043 r63328
I misread the original bug report and got results flipped.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03 01:24:09 +00:00
normal 6afea14043 ext/cgi/escape: preserve String subclass in result
* ext/cgi/escape/escape.c (optimized_escape_html): use rb_str_new_with_class
  (optimized_unescape_html): ditto
  (optimized_escape): ditto
  (optimized_unescape): ditto
* test/cgi/test_cgi_util.rb (test_escape_string_subclass): new test
  [ruby-core:86847] [Bug #14732]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02 23:18:55 +00:00
nobu 41f4ac6aa2 ast.c: use enum in switch for warnings
* ext/-test-/ast/ast.c (node_children): use enum instead of int
  for not-handled enumeration value in switch warnings.

* ext/-test-/ast/ast.c (node_children): fix the rb_bug message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-01 06:55:43 +00:00
nobu 7727b22eb1 io.c: workaround for EPROTOTYPE
* io.c (internal_write_func, internal_writev_func): retry at
  unexpected EPROTOTYPE on macOS, to get rid of a kernel bug.
  [ruby-core:86690] [Bug #14713]

* ext/socket/init.c (rsock_{sendto,send,write}_blocking): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-30 02:17:03 +00:00
hsbt f114089585 Merge Pysch 3.0.3.pre1.
I added the following additional commits from 3.0.3.pre1:
    * https://github.com/ruby/psych/pull/356
    * https://github.com/ruby/psych/pull/357
    * https://github.com/ruby/psych/pull/359

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28 01:47:58 +00:00
nobu eb02a846a4 fiddle/import.rb: suppress warning
* ext/fiddle/lib/fiddle/import.rb: suppress exception report when
  $DEBUG is enabled.  [ruby-core:86536] [Bug #14686]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-19 23:35:39 +00:00
nobu 3be4550558 Win32API.rb: use uplevel option to warn
Also warns always regardless $VERBOSE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-02 12:39:01 +00:00
nobu b78fa27ae0 unixsocket.c: abstract namespace
* ext/socket/unixsocket.c (unixsock_path_value): fix r62991 for
  Linux abstract namespace.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-28 11:30:27 +00:00
nobu 8794dec6a5 unixsocket.c: check NUL bytes
* ext/socket/unixsocket.c (rsock_init_unixsock): check NUL bytes.
  https://hackerone.com/reports/302997

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-28 10:08:57 +00:00
nobu ee83dc3fe4 bigdecimal.c: fix missing argument
* ext/bigdecimal/bigdecimal.c (rb_rational_num, rb_rational_den):
  fix missing argc argument for old ruby.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26 00:25:16 +00:00
nobu 21a63760c9 extmk.rb: get rid of shadowing outer local variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-25 01:52:22 +00:00
nobu b4b3de3e7c node.c: predicates for special NODEs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-20 13:30:57 +00:00
k0kubun 67bb95936d Fix FrozenError on `Ripper.slice`
Currently `Ripper.slice` raises a FrozenError

```ruby
require 'ripper'
p Ripper.slice('foo', 'ident')
```

```
/path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `concat': can't modify frozen String (FrozenError)
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:193:in `block in compile'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `scan'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:190:in `compile'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:169:in `initialize'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `new'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:151:in `token_match'
	from /path/to/g/lib/ruby/2.6.0/ripper/lexer.rb:144:in `slice'
	from /tmp/tmp.kb4cnhvum2/test.rb:2:in `<main>'
```

This patch will fix the problem.

[Fix GH-1837]

From: Masataka Pocke Kuwabara <kuwabara@pocke.me>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 12:56:04 +00:00