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

7160 Коммитов

Автор SHA1 Сообщение Дата
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
watson1978 ccc2576514 Improve Pathname performance
If it will not use special variables (like $1, $&, $`...),
it can improve the performance by using Regexp#match? instead of Regexp#=~.
Because Regexp#=~ will generate the objects to special variables by pattern matching.

This patch will replace Regexp#=~ without special variables to Regexp#match?.
(Excludes https://github.com/ruby/ruby/blob/trunk/ext/pathname/lib/pathname.rb#L144-L153)

[Fix GH-1836] [ruby-core:86093] [Bug #14599]

## Environment
* OS : Ubuntu 17.10
* Compiler : gcc version 7.2.0
* CPU : Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
* Memory : 16 GB

## TL;DR
                            | Before | After  | Speed up
--------------------------- | ------ | ------ | --------
Pathname#absolute?          | 142836 | 198487 | 39.0%
Pathname#cleanpath          |  60706 |  79415 | 30.8%
Pathname#root?              | 603806 | 759157 | 25.7%
Pathname#absolute?          | 142592 | 197859 | 38.8%
Pathname#each_filename      | 115600 | 152982 | 32.3%
Pathname#ascend             |  50494 |  63606 | 26.0%
Pathname#+                  | 100550 | 130372 | 29.7%
Pathname#join               |  46673 |  60994 | 30.7%
Pathname#relative_path_from |  28362 |  37494 | 32.2%

## Before
```
Calculating -------------------------------------
  Pathname#absolute?    142.836k (± 0.1%) i/s -    722.304k in   5.056884s
  Pathname#cleanpath     60.706k (± 0.1%) i/s -    306.764k in   5.053305s
      Pathname#root?    603.806k (± 0.3%) i/s -      3.062M in   5.071696s
  Pathname#absolute?    142.592k (± 0.1%) i/s -    720.846k in   5.055301s
Pathname#each_filename
                        115.600k (± 0.1%) i/s -    586.818k in   5.076292s
     Pathname#ascend     50.494k (± 0.1%) i/s -    255.301k in   5.056049s
          Pathname#+    100.550k (± 0.1%) i/s -    509.630k in   5.068433s
       Pathname#join     46.673k (± 0.1%) i/s -    236.433k in   5.065696s
Pathname#relative_path_from
                         28.362k (± 0.0%) i/s -    143.728k in   5.067640s
```

## After
```
Calculating -------------------------------------
  Pathname#absolute?    198.487k (± 0.1%) i/s -    995.665k in   5.016272s
  Pathname#cleanpath     79.415k (± 0.1%) i/s -    404.406k in   5.092344s
      Pathname#root?    759.157k (± 0.0%) i/s -      3.800M in   5.005072s
  Pathname#absolute?    197.859k (± 0.1%) i/s -    995.720k in   5.032494s
Pathname#each_filename
                        152.982k (± 0.1%) i/s -    775.555k in   5.069607s
     Pathname#ascend     63.606k (± 0.0%) i/s -    320.862k in   5.044560s
          Pathname#+    130.372k (± 0.1%) i/s -    660.856k in   5.068991s
       Pathname#join     60.994k (± 0.1%) i/s -    305.068k in   5.001626s
Pathname#relative_path_from
                         37.494k (± 0.4%) i/s -    189.124k in   5.044146s
```

## Benchmark code
```ruby
require 'pathname'
require 'benchmark/ips'

Benchmark.ips do |x|
  root  = Pathname.new('/')
  path1 = Pathname.new('/path/to/some/file1.rb')
  path2 = Pathname.new('/path/to/some/file2.rb')

  x.report("Pathname#absolute?") do
    path1.absolute?
  end

  x.report("Pathname#cleanpath") do
    Pathname.new('/path/to/some/file.rb').cleanpath
  end

  x.report("Pathname#root?") do
    path1.root?
  end

  x.report("Pathname#absolute?") do
    path1.absolute?
  end

  x.report("Pathname#each_filename") do
    path1.each_filename { |file| }
  end

  x.report("Pathname#ascend") do
    path1.ascend { |path| }
  end

  x.report("Pathname#+") do
    path1 + path2
  end

  x.report("Pathname#join") do
    path1.join("../file3.rb")
  end

  x.report("Pathname#relative_path_from") do
    path1.relative_path_from(root)
  end
end
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 09:15:10 +00:00
nobu 7773cfa496 ripper: fix escaped space
* parse.y: use tSP same as ripper instead of tSPACE.
  [ruby-core:86080] [Bug #14597]

* ext/ripper/eventids2.c: tSP is defined in ripper.c now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-12 07:55:17 +00:00
suke e144481ed5 ext/win32ole/win32ole.c: fix typo. [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-10 06:46:01 +00:00
suke b11a38fa48 * ext/win32ole/win32ole.c: fix url of ActiveState. Thanks to Kazuhiro Nishiyama. [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-10 02:16:30 +00:00
nobu 576b245ffa Removed useless assertions [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-09 03:51:04 +00:00
nobu 7ab3f98604 date_core.c: check conversion
* ext/date/date_core.c (offset_to_sec, d_lite_plus): check
  conversion results, to get rid of infinite recursion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-07 08:07:24 +00:00
nobu 8032b00f8e openssl: search winsock
* ext/openssl/extconf.rb: on Windows search winsock library
  always, regardless pkg-config.  direct use of winsock is not
  region of OpenSSL.  [ruby-core:85895] [Bug #14568]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 14:45:28 +00:00
nobu 1de78c5fd8 io/console: drop 2.1.0 support [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 11:24:29 +00:00
nobu 013016b986 io/console: drop 2.0.0 support [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 07:53:27 +00:00
nobu 11bc984efe search winsock libraries explicitly
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-02 04:36:14 +00:00
k0kubun 3406c5d613 Refactor ERB version checking for keyword arguments
Improving code like r62590. See r62529 for details.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-27 11:12:23 +00:00
nobu d1ea2f9d8f date_parse.c, date_strptime.c: ensure symbols static all
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-25 13:17:35 +00:00
nobu a32e4169e1 date_core.c: ensure symbols static all
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-25 04:49:51 +00:00
nobu d3d845396e date_core.c: defensive code
* ext/date/date_core.c (f_cmp): check comparison failure.

* ext/date/date_core.c (d_lite_step): deal with the comparison
  result more defensively.  [ruby-core:85796] [Bug #14549]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-25 04:28:11 +00:00
k0kubun cc777d09f4 erb.rb: deprecate safe_level of ERB.new
Also, as it's in the middle of the list of 4 arguments, 3rd and 4th arguments
(trim_mode, eoutvar) are changed to keyword arguments.
Old ways to specify arguments are deprecated and warned now.

bin/erb: deprecate -S option.

We'll remove all of deprecated ones at Ruby 2.7+.

enc/make_encmake.rb: stopped using deprecated interface
ext/etc/mkconstants.rb: ditto
ext/socket/mkconstants.rb: ditto
sample/ripper/ruby2html.rb: ditto
spec/ruby/library/erb/defmethod/def_erb_method_spec.rb: ditto
spec/ruby/library/erb/new_spec.rb: ditto
test/erb/test_erb.rb: ditto
test/erb/test_erb_command.rb: ditto
tool/generic_erb.rb: ditto
tool/ruby_vm/helpers/dumper.rb: ditto
tool/transcode-tblgen.rb: ditto
lib/rdoc/erbio.rb: ditto
lib/rdoc/generator/darkfish.rb: ditto

[Feature #14256]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22 13:28:25 +00:00
normal 604a96d9de ext/fiddle/lib/fiddle/pack.rb: pack "void *" properly on 32-bit
Fixes: r62450 (commit 1aaeeb326e)
       ("long long is a C99ism")

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-18 00:38:35 +00:00
shyouhei 1aaeeb326e long long is a C99ism
so SIZEOF_LONG_LONG is not always available.
We have to check its defined?-ness before using.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-17 09:51:23 +00:00
nobu 131dc83145 socket.rb: protected connect_internal
* ext/socket/lib/socket.rb (Addrinfo#connect_internal): make
  protected for Addrinfo#connect_to, instead of private and send.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-17 07:54:52 +00:00
shyouhei 28d0fee9f6 add casts (cosmetic; just be explicit)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16 08:49:09 +00:00
nobu c8094ff154 no ID cache in Init functions
Init functions are called only once, cache is useless.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-16 08:39:48 +00:00
normal 3ce9a14040 ruby.h: relax rb_funcall check on extra args for clang
clang 5.+ (tested clang 7.0.0) seems to be attempting division-by-zero
and giving a very large number for static args to rb_funcall.

* include/ruby/ruby.h (rb_varargs_bad_length): relax check for clang
* ext/-test-/funcall/funcall.c: renamed from passing_block.c
  define extra_args_name function
* test/-ext-/funcall/test_funcall.rb: new test
  [ruby-core:85266] [Bug #14425]

From: Eric Wong <e@80x24.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 23:55:49 +00:00
nobu f36688449b ignore external library sources [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 03:13:33 +00:00
nobu acdc2f099e ext/psych/.gitignore: removed stale file [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26 03:13:32 +00:00
nobu 07decad25f openssl/buffering.rb: no RS when output
* ext/openssl/lib/openssl/buffering.rb (do_write, puts): output
  methods should not be affected by the input record separator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-25 11:21:47 +00:00
k0kubun fb29cffab0 process.c: add :exception option to Kernel.#system
to raise error when it fails.

[Feature 14386] [GH-1795]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-24 14:11:25 +00:00
nobu a41005eb6a init.c: encode socket error message
* ext/socket/init.c (rsock_raise_socket_error): on Windows, encode
  error messages from wide characters to the default encodings.
  [ruby-core:84972] [Bug #14384]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 15:31:22 +00:00
nobu fb6c4ca168 getaddrinfo.c: ai_errlist
* ext/socket/getaddrinfo.c (ai_errlist): used only if gai_strerror
  is missing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-23 15:31:21 +00:00
mame 8a489a7d6f ext/ripper/tools/dsl.rb: Use String#sub instead of delete_suffix
It fails when baseruby is old.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:52:51 +00:00
mame 5db2894229 parse.y: Remove double meaning of new_qcall/new_command_qcall
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:45:25 +00:00
mame d24f1fddd7 ext/ripper/tools/dsl.rb: Serialize dispatch calls
To avoid the unspecified behavior (the evaluation order of arguments).
In `$$ = foo(bar(), baz());`, it is unspecified which `bar` or `baz` is
called earlier.

This commit changes the code to `v1=bar(); v2=baz(); $$ = foo();`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 17:45:24 +00:00
mame 9e95513781 parse.y: Remove unneeded var_field_1 trick
I thought this trick was needed because the result of var_field was
passed to different arguments, as follows:

```
$1 = var_field(p, $1);
$$ = backref_assign_error(p, $1, $1, &@$);
```

Currently the DSL supports that one result is passed to one argument.

However, after the refactoring, I found that `backref_assign_error`
uses only one `$1`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 06:11:21 +00:00
nobu 0b8594209d dsl.rb: p
* ext/ripper/tools/dsl.rb (DSL#initialize): define `p` for `struct
  parser_params *p`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:39:03 +00:00
nobu b5be3e7893 dsl.rb: ID constants
* ext/ripper/tools/dsl.rb (DSL#method_missing): expand ID
  constnats without parentheses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:39:02 +00:00
nobu b54f2addaa dsl.rb: const_missing
* ext/ripper/tools/dsl.rb (DSL.const_missing): define to expand
  Qnil and Qundef as-is.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:39:01 +00:00
nobu 23830ab9b2 dsl.rb: indent
* ext/ripper/tools/dsl.rb (DSL#generate): indent after surrounding
  by braces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-20 05:39:00 +00:00
mame 193b158b23 parse.y: Remove double meaning of backref_assign_error
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 16:24:07 +00:00
mame a64054cd34 parse.y: Remove unneeded type decls for Ripper
I think that they are not used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 15:43:42 +00:00
mame c141a0f7e7 parse.y: swap `foo!` and `foo` in Ripper DSL
`foo!(...)` means Ripper event, and `foo(...)` means C function/macro
call.  This is for fail-safe; if I forget `!` accidentally, it would
fail to compile, instead of wrongly adding a new Ripper event.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 15:22:36 +00:00
mame bf7621d81d parse.y: Allows Ripper DSL to embed C function calls as `foo!`
Instead of `_foo`.  This makes it useful to do word boundary search of
the editor.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 13:11:11 +00:00
mame b1746e9e47 ext/ripper/tools/preproc.rb: Remove `/*%c%` handling
It was replaced with `/*% ripper[brace]: ... %*/`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 11:10:30 +00:00
mame 9b7fe0a250 ext/ripper: Introduce a simple DSL for ripper.y code generation
Currently, parse.y actions are hard to read and write because the code
has double meaning (for core parser and for ripper).  I think that, if
it is easy to write ripper's code shortly and simply, the double meaning
trick is not needed.

For the sake, this change adds a simple DSL for ripper's code.  For
example, in parse.y, we can write:

    /*% ripper: stmts_add(stmts_new, void_stmt) %*/

instead of:

    $$ = dispatch2(stmts_add, dispatch0(stmts_new),
                   dispatch0(void_stmt));

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-19 10:48:08 +00:00
nobu 37f0d53290 marked as NORETURN
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18 11:34:36 +00:00
nobu 1c98a41ae3 win32/resolv.rb: call rb_w32_osid
* ext/win32/lib/win32/resolv.rb: call rb_w32_osid instead of
  direct GetVersionExA API.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18 01:10:22 +00:00
mame d52c977f29 ext/ripper/depend: Try to fix the path of id.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-17 10:17:16 +00:00
nobu d611e071fe ripper.c: depends on preproc.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-17 04:25:39 +00:00
mame 4b6f3bce25 node.c: Stop double meaning of NODE_FOR by introducing NODE_FOR_MASGN
NODE_FOR was used both for "for"-statement itself and for
multi-assignment of for-statement (for x, y, in...end).
This change separates the two purposes, NODE_FOR for the former, and
newly introduced NODE_FOR_MASGN for the latter.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-16 07:24:53 +00:00
yui-knk 0f3dcbdf38 Add tests for Node code locations
* test/-ext-/ast/test_ast.rb: Add tests for Node
  code locations. This file tests

  1. There are no Node whose code location is default
     value (#test_not_cared)

  2. There are no Node whose children's code locations
     exceed parent's code location (#test_ranges)

* ext/-test-/ast/ast.c, ext/-test-/ast/extconf.rb:
  Define AST module to help tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 23:43:17 +00:00
nobu 79a2517026 test_console_attr.rb: fix test
* test/-ext-/win32/test_console_attr.rb (reverse_video): fix test
  when reverse video is set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 12:25:24 +00:00
nobu 995717e15c raddrinfo.c: fix parse_numeric_port
* ext/socket/raddrinfo.c (parse_numeric_port): necessary
  regardless of GETADDRINFO_EMU.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 07:01:08 +00:00
kazu 51edb30042 Include ruby/{io,encoding}.h before internal.h
because of r61712 and r61713

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 12:35:12 +00:00
nobu aaa18bae72 update dependencies
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 06:55:55 +00:00
nobu e9cb552ec9 internal.h: remove dependecy on ruby/encoding.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09 06:24:11 +00:00
normal 787fab5bbf zlib: reduce garbage on Zlib::GzipReader#readpartial
For garbage-concious users who use the `outbuf' argument of
`readpartial' to supply a destination buffer, this provides
a drastic reduction in garbage when inflating large inputs
in a streaming fashion.

This results in a anonymous RSS reduction in the reader
similar to the reduction in the writer from r61631.

Results using the test script from r61631
<https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61631>

Before:

        writer   7.359999   0.000000   7.359999 (  7.360639)
        writer RssAnon:     4040 kB
        reader   6.346667   0.070000   6.416667 (  7.387654)
        reader RssAnon:    98272 kB

After:

        writer   7.309999   0.000000   7.309999 (  7.310651)
        writer RssAnon:	    4048 kB
        reader   6.146666   0.003333   6.149999 (  7.334868)
        reader RssAnon:	    4300 kB

* ext/zlib/zlib.c (struct read_raw_arg): new struct
  (gzfile_read_raw_partial): use read_raw_arg
  (gzfile_read_raw_rescue): ditto
  (gzfile_read_raw): accept outbuf, use read_raw_arg
  (gzfile_read_raw_ensure): accept outbuf
  (gzfile_read_header): ditto
  (gzfile_check_footer): ditto
  (gzfile_read_more): ditto
  (gzfile_read_raw_until_zero): adjust for changes
  (gzfile_fill): ditto
  (gzfile_readpartial): ditto
  (gzfile_read_all): ditto
  (gzfile_getc): ditto
  (gzfile_reader_end_run): ditto
  (gzfile_reader_get_unused): ditto
  (rb_gzreader_initialize): ditto
  (gzreader_skip_linebreaks): ditto
  (gzreader_gets): ditto
  (zlib_gunzip_run): ditto
  [ruby-core:84660] [Feature #14319]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-08 01:11:38 +00:00
nobu 4328d1f50d extmk.rb: exclude recursively
* ext/extmk.rb: exclude extension libraries recursively.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07 02:49:27 +00:00
normal a55abcc0ca zlib: reduce garbage on gzip writes (deflate)
Zlib::GzipWriter generated large amounts of garbage from
(struct zstream).input.  Reuse the .input field when it is
hidden, and recycle it when its lifetime is over.  This change
alone reduced memory usage of the writer from 90MB to 4.5MB.

For the detached buffer of compressed data used by
gzfile_write_raw, we can only clear the string (not recycle it)
since user code may hold references to it (but the data would be
clobbered, anyways).  This reduced memory usage slightly by
around 0.5MB (because it's smaller compressed data).

Combined, these changes reduce the anonymous RSS memory of a
dedicated writer process from over 90MB to under 4MB.

before:

    #      user     system      total        real

    writer   7.823332   0.053333   7.876665 (  7.881464)
    writer RssAnon:    92944 kB
    reader   6.969999   0.076666   7.046665 (  7.906377)
    reader RssAnon:   109820 kB

after:

    writer   7.359999   0.000000   7.359999 (  7.360639)
    writer RssAnon:     4040 kB
    reader   6.346667   0.070000   6.416667 (  7.387654)
    reader RssAnon:    98272 kB

Script used:
-------
require 'zlib'
require 'benchmark'
nr = 16384 * 2

def stats(pfx, bm)
  str = "#{bm}#{File.readlines("/proc/#$$/status").grep(/^RssAnon:/)[0]}"
  puts str.gsub!(/^/m, pfx)
end

rd, wr = IO.pipe
pid = fork do
  buf = ((0..255).map(&:chr).join * 128).freeze
  rd.close
  gzip = Zlib::GzipWriter.new(wr)
  bm = Benchmark.measure do
    nr.times { gzip.write(buf) }
    gzip.close
    wr.close
  end
  stats('writer ', bm)
end

wr.close
buf = ''
gunzip = Zlib::GzipReader.new(rd)
n = 0
bm = Benchmark.measure do
  begin
    gunzip.readpartial(16384, buf)
    n += buf.size
  rescue EOFError
    break
  end while true
end
stats('reader ', bm)
Process.waitall
-------
* ext/zlib/zlib.c (zstream_discard_input): reuse or recycle hidden input
  (zstream_reset_input): clear hidden input
  (zstream_run): detach input and recycle after use
  (gzfile_write_raw): clear buffer after write
  [ruby-core:84638] [Feature #14315]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-05 20:48:55 +00:00