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

7371 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada a3daf8e49a
Ensure that unmatched arity fails in C++ 2019-09-19 20:57:58 +09:00
Nobuyoshi Nakada b3ddeac33e
Revert "DEBUG: dump mkmf.log"
This reverts commit 69e209a345.

The debug has finishted.
2019-09-19 20:57:57 +09:00
Nobuyoshi Nakada df3fd50717
Removed mkmf.log dump in Makefile 2019-09-19 12:25:48 +09:00
Nobuyoshi Nakada 69e209a345
DEBUG: dump mkmf.log 2019-09-19 12:03:58 +09:00
Nobuyoshi Nakada 2d1e3bd8f1
DEBUG: cxxanyargs 2019-09-19 11:25:09 +09:00
Nobuyoshi Nakada a98181eb11
DEBUG: cxxanyargs 2019-09-19 10:46:52 +09:00
Nobuyoshi Nakada a9cdaaada4
DEBUG 2019-09-19 08:47:07 +09:00
Nobuyoshi Nakada 842f600a93
Look up the language module
Look up language module with `MakeMakefile.[]`, insted of a
accessing constant under that module directly, to get rid of
expose the constant to the toplevel inadvertently.
2019-09-19 00:03:18 +09:00
Nobuyoshi Nakada 15d5de59fb
Removed unused keyword argument [ci skip] 2019-09-19 00:03:18 +09:00
Nobuyoshi Nakada c3f03da494
[EXPERIMENTAL] MakeMakefile::CXX for C++ 2019-09-18 18:47:02 +09:00
Jeremy Evans 9b35dc3864 Pass keyword argument flag when rb_call_super_kw calls method_missing
This makes method_missing take a flag for whether keyword arguments
were passed.

Adds tests both for rb_call_super_kw usage as well as general usage
of super calling method_missing in Ruby methods.
2019-09-17 16:22:44 -07:00
Nobuyoshi Nakada 6d2dcf9632 [ruby/io-console] Added `intr:` option to IO#raw
Enters raw-mode but enable interrupts.

https://github.com/ruby/io-console/commit/7cba76561a
2019-09-14 23:27:53 +09:00
Nobuyoshi Nakada 83ef58f264 [ruby/io-console] Suppress yet another warning on Windows
https://github.com/ruby/io-console/commit/4e17c90788
2019-09-10 17:29:11 +09:00
Nobuyoshi Nakada b5ab918d0c [ruby/io-console] Suppress warnings on Windows
About unused variables and a function.

https://github.com/ruby/io-console/commit/32baf54e7a
2019-09-10 17:29:09 +09:00
Masaki Matsushita 0e9d56f5e7 Support timeout for Addrinfo
Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as
a keyword argument. If getaddrinfo_a(3) is available, the timeout will be
applied for name resolution. Otherwise, it will be ignored.

Socket.tcp accepts :resolv_timeout to use this feature.

This commit is retry of 6382f5cc91.
Test was failed on Solaris machines which don't have "http" in
/etc/services. In this commit, use "ssh" instead.
2019-09-10 10:10:59 +09:00
Nobuyoshi Nakada 3678c37119 [ruby/io-console] Added IO#check_winsize_changed on Windows
https://github.com/ruby/io-console/commit/ee648fa8bb
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada 74790e2dc4 [ruby/io-console] Added scroll methods
https://github.com/ruby/io-console/commit/83e70de8ab
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada c1412bd6d9 [ruby/io-console] Added line/screen erase methods
https://github.com/ruby/io-console/commit/e6344108a1
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada 9844a349bf [ruby/io-console] Added IO#goto_column
https://github.com/ruby/io-console/commit/143a9d5764
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada e8be056af9 [ruby/io-console] Added relative cursor move methods
https://github.com/ruby/io-console/commit/21d340e4a2
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada 3d9c7c2835 [ruby/io-console] Added IO#goto and IO#cursor= for VT
https://github.com/ruby/io-console/commit/7f2b1b473d
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada 53ed4fb376 [ruby/io-console] Added IO#cursor for VT
https://github.com/ruby/io-console/commit/41a6a6cace
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada 803dc9e1e4 [ruby/io-console] Added console_vt_response
A function to query console info.

https://github.com/ruby/io-console/commit/db75a07fa3
2019-09-10 08:18:03 +09:00
Nobuyoshi Nakada f4aa06c0ff [ruby/io-console] Drop fat gem support
https://github.com/ruby/io-console/commit/972ceb081d
2019-09-10 08:18:03 +09:00
卜部昌平 89c5d5a64e add minimaist C++ check
This is a test extension so we basically want test failures rather
than a configure breakage but if there is no C++ compiler, we need
no test at all because there will be no chance for the tested
header file to be used later.

This makes it possible to build the ruby binary without any C++
compiler installed in a build environment.
2019-09-09 21:27:40 +09:00
卜部昌平 042c436cd9 static member variables must explictly be initialized
These variables then get their room for storage.

See also https://github.com/ruby/ruby/runs/214042030
2019-09-09 21:27:40 +09:00
卜部昌平 92a8726994 Revert "save committers' weekend from CI failures"
This reverts commit 53d21087da.
2019-09-09 21:27:40 +09:00
Masaki Matsushita c4efbf663e Revert "Support timeout for Addrinfo"
This reverts commit 6382f5cc91.
test failed on Solaris.
2019-09-09 20:34:51 +09:00
Masaki Matsushita 6382f5cc91 Support timeout for Addrinfo
Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as
a keyword argument. If getaddrinfo_a(3) is available, the timeout will be
applied for name resolution. Otherwise, it will be ignored.

Socket.tcp accepts :resolv_timeout to use this feature.
2019-09-09 14:34:05 +09:00
Yusuke Endoh 99c9431ea1 Rename NODE_ARRAY to NODE_LIST to reflect its actual use cases
and NODE_ZARRAY to NODE_ZLIST.

NODE_ARRAY is used not only by an Array literal, but also the contents
of Hash literals, method call arguments, dynamic string literals, etc.
In addition, the structure of NODE_ARRAY is a linked list, not an array.

This is very confusing, so I believe `NODE_LIST` is a better name.
2019-09-07 13:56:29 +09:00
Kazuhiro NISHIYAMA f223ab47e6
[DOC] Update output of Ripper.sexp [ci skip] 2019-09-07 13:50:05 +09:00
卜部昌平 53d21087da save committers' weekend from CI failures
Kill the failing tests.
2019-09-06 18:20:11 +09:00
卜部昌平 1851dc269c avoid name mangling
Otherwise the dynamic linker cannot find this function.
See also https://ci.appveyor.com/project/ruby/ruby/builds/27224231/job/4pg6lxlsnsjotu2l
2019-09-06 16:52:20 +09:00
卜部昌平 2aa4fb57d1 nullptr is a C++11ism.
Should use numeric 0 for maximum portability.
See also https://travis-ci.org/ruby/ruby/jobs/581543798
2019-09-06 16:42:45 +09:00
卜部昌平 7516c48b27 fix Visual Studio compilation error
See also https://github.com/ruby/ruby/runs/213964487
2019-09-06 16:33:30 +09:00
卜部昌平 04f570e266 add test for cxxanyargs.hpp 2019-09-06 15:50:58 +09:00
卜部昌平 3df37259d8 drop-in type check for rb_define_singleton_method
We can check the function pointer passed to
rb_define_singleton_method like how we do so in rb_define_method.
Doing so revealed many arity mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平 7b6fde4258 drop-in type check for rb_define_module_function
We can check the function pointer passed to rb_define_module_function
like how we do so in rb_define_method.  The difference is that this
changeset reveales lots of atiry mismatches.
2019-08-29 18:34:09 +09:00
卜部昌平 48e346a088 fix arity of bug_start
This is just a trivial mistake introduced in
0f36e8fc03.
2019-08-29 18:34:09 +09:00
Nobuyoshi Nakada 2ed68d0ff9
Revert "Add pipeline operator [Feature #15799]"
This reverts commits:
* d365fd5a02
* d780c36624
* aa7211836b
* 043f010c28
* bb4dd7c6af05c7821d572e2592ea3d0cc748d81f
* 043f010c28
* f169043d81

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/94645
2019-08-29 15:27:59 +09:00
卜部昌平 6dd60cf114 st_foreach now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
st_foreach.  I strongly believe that this commit should have had come
with b0af0592fd, which added extra
parameter to st_foreach callbacks.
2019-08-27 15:52:26 +09:00
卜部昌平 af5e256640 rb_catch now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_catch, and fixes some bugs revealed by that.
2019-08-27 15:52:26 +09:00
卜部昌平 703783324c rb_ensure now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_ensure, which also revealed many arity / type mismatches.
2019-08-27 15:52:26 +09:00
卜部昌平 5c7c2d9951 rb_rescue / rb_rescue2 now free from ANYARGS
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit deletes ANYARGS from
rb_rescue / rb_rescue2, which revealed many arity / type mismatches.
2019-08-27 15:52:26 +09:00
卜部昌平 3cae73133c rb_iterate now takes rb_block_call_func_t
After 5e86b005c0, I now think ANYARGS is
dangerous and should be extinct.  This commit makes rb_iterate free
from ANYARGS.
2019-08-27 15:52:26 +09:00
Yusuke Endoh 571ffcd609 ext/psych/yaml/api.c: Suppress a "variable set but not used" warning
```
compiling ../.././ext/psych/yaml/api.c
../.././ext/psych/yaml/api.c: In function 'yaml_document_delete':
../.././ext/psych/yaml/api.c:1122:7: warning: variable 'context' set but not used [-Wunused-but-set-variable]
     } context;
       ^~~~~~~
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-master/log/20190824T093004Z.log.html.gz
2019-08-24 20:31:16 +09:00
Nobuyoshi Nakada 2e28b3678f [ruby/stringio] Fixed a typo
b249631c43 (commitcomment-34804150)

https://github.com/ruby/stringio/commit/998d6257fb
2019-08-23 20:52:53 +09:00
Nobuyoshi Nakada a5b809e994
Check metadata a bit more 2019-08-23 13:00:17 +09:00
Nobuyoshi Nakada 650cd24555
Hoisted out get_digest_obj_metadata 2019-08-23 12:27:48 +09:00
Nobuyoshi Nakada a963851100
Hoisted out rb_id_metadata 2019-08-22 00:19:56 +09:00
Nobuyoshi Nakada 74c6662af5
Hoisted out rb_digest_namespace 2019-08-22 00:19:55 +09:00
Nobuyoshi Nakada 3df9f3cc13
Separated initializing IDs 2019-08-21 16:20:31 +09:00
Nobuyoshi Nakada 619f82bb6b
Hoisted out unixsocket_len, triming NUL chars from sun_path 2019-08-16 17:44:45 +09:00
Nobuyoshi Nakada cad41bb6d3
[ruby/stringio] Supported BOM
https://github.com/ruby/stringio/commit/b249631c43
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada 22e942deb2
[ruby/stringio] Supported `mode:` option
https://github.com/ruby/stringio/commit/53def32ba0
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada 8b44307894
[ruby/stringio] Allow bignum mode
https://github.com/ruby/stringio/commit/d28927b561
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada e54d349a01
[ruby/stringio] Added support for older versions
https://github.com/ruby/stringio/commit/c4a13d41cd
https://github.com/ruby/stringio/commit/359c9f395c
2019-08-14 11:20:58 +09:00
Nobuyoshi Nakada c8f9e9a2a0
[ruby/stringio] stringio: encoding support
https://github.com/ruby/stringio/commit/7b20075ab0
2019-08-14 11:20:57 +09:00
Nobuyoshi Nakada 3fc10eff1e
date_parse.c: trim off
* ext/date/date_parse.c (date_zone_to_diff): trim off by zone name
  length.
2019-08-12 20:41:11 +09:00
Nobuyoshi Nakada d96feee37c
date_parse.c: avoid copying
* ext/date/date_parse.c (date_zone_to_diff): get rid of copying
  the whole argument string.
2019-08-12 20:41:11 +09:00
Nobuyoshi Nakada ffdef3674a
Warn instance variable `E`
It is not dumped, as it is a short alias for `:encoding`.
2019-08-10 13:18:41 +09:00
Yusuke Endoh 8877dbe400 ext/ripper/lib/ripper/lexer.rb: Consistently use `Array#push`
instead of <<.  All the other callsites use `push`.
2019-08-07 03:13:17 +09:00
Yusuke Endoh ef8c5161b4 ext/ripper/lib/ripper/lexer.rb: fix a wrong delegation
The target method name is a typo.
2019-08-07 03:12:49 +09:00
Jeremy Evans 2b6441196e Remove documentation of %m in Syslog
Fixes [Bug #6726]
2019-08-05 16:10:25 -07:00
Yusuke Endoh 58a478bce4 ext/psych/yaml/loader.c: Cast the difference of pointers to int
instead of casting a pointer to int.
Follow up of 39622232c7.
2019-08-05 14:38:59 +09:00
Hiroshi SHIBATA 39622232c7
Suppress warnings of bundled libyaml. 2019-08-04 20:12:43 +09:00
David Carlier 2d189a6721
yaml few build warning fixes
Closes: https://github.com/ruby/ruby/pull/2283
2019-08-04 09:46:46 +09:00
Dmitry Petrashko b6cfacc85d
Remove dependency on `openssl/conf_api.h`
None of the functions defined in this header are actually used in Ruby.
Fixes build against boringssl that does not have this file.
Closes: https://github.com/ruby/ruby/pull/2210
2019-08-04 09:25:32 +09:00
Yusuke Endoh b8e351a1b9 ext/-test-/bug-14834/bug-14384.c: fallback for MAYBE_UNUSED
__unused__ is unavailable on Sun C.
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20190801T112505Z.fail.html.gz
2019-08-01 21:09:59 +09:00
卜部昌平 fd0e3bd249 fix VC 2013 compile error
It seems the compiler does not support VLAs.
See also: https://ci.appveyor.com/project/ruby/ruby/builds/26392589/job/px6nuiuw4e78weg1
2019-08-01 16:19:49 +09:00
卜部昌平 5d33f78716 fix tracepoint + backtrace SEGV
PC modification in gc_event_hook_body was careless.  There are (so
to say) abnormal iseqs stored in the cfp.  We have to check sanity
before we touch the PC.

This has not been fixed because there was no way to (ab)use the
setup from pure-Ruby.  However by using our official C APIs it is
possible to touch such frame(s), resulting in SEGV.

Fixes [Bug #14834].
2019-08-01 16:00:59 +09:00
git e315f3a134 * expand tabs. 2019-07-31 10:22:47 +09:00
Koichi Sasada 72825c35b0 Use 1 byte hint for ar_table [Feature #15602]
On ar_table, Do not keep a full-length hash value (FLHV, 8 bytes)
but keep a 1 byte hint from a FLHV (lowest byte of FLHV).
An ar_table only contains at least 8 entries, so hints consumes
8 bytes at most. We can store hints in RHash::ar_hint.

On 32bit CPU, we use 4 entries ar_table.

The advantages:
* We don't need to keep FLHV so ar_table only consumes
  16 bytes (VALUEs of key and value) * 8 entries = 128 bytes.
* We don't need to scan ar_table, but only need to check hints
  in many cases. Especially we don't need to access ar_table
  if there is no match entries (in many cases).
  It will increase memory cache locality.

The disadvantages:
* This technique can increase `#eql?` time because hints can
  conflicts (in theory, it conflicts once in 256 times).
  It can introduce incompatibility if there is a object x where
  x.eql? returns true even if hash values are different.
  I believe we don't need to care such irregular case.
* We need to re-calculate FLHV if we need to switch from ar_table
  to st_table (e.g. exceeds 8 entries).
  It also can introduce incompatibility, on mutating key objects.
  I believe we don't need to care such irregular case too.

Add new debug counters to measure the performance:
* artable_hint_hit - hint is matched and eql?#=>true
* artable_hint_miss - hint is not matched but eql?#=>false
* artable_hint_notfound - lookup counts
2019-07-31 09:52:03 +09:00
Nobuyoshi Nakada 077c28887a
[ruby/io-console] Do not use add_development_dependency
https://github.com/ruby/io-console/commit/bc77f46391
2019-07-25 08:16:57 +09:00
Nobuyoshi Nakada 414d6cf1d3 [ruby/psych] Get rid of C90 feature
For ruby 2.6 and earlier.

https://travis-ci.org/ruby/psych/jobs/562435717#L245-L248

```
../../../../ext/psych/psych_parser.c: In function ‘make_exception’:
../../../../ext/psych/psych_parser.c:87:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     VALUE ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
     ^
```

https://github.com/ruby/psych/commit/aa457443b8
2019-07-25 07:52:19 +09:00
Jean Boussier 6ca7dc69ef [ruby/psych] Deduplicate hash keys if they're strings
https://github.com/ruby/psych/commit/0414982ffd
2019-07-25 07:52:16 +09:00
Hiroshi SHIBATA 50076903ab
[ruby/psych] Drop to support fat gem support.
ref. https://github.com/ruby/bigdecimal/pull/149

https://github.com/ruby/psych/commit/25ae263252
2019-07-25 07:50:37 +09:00
Hiroshi SHIBATA 938032a790
[ruby/psych] Do not use add_development_dependency.
https://github.com/ruby/psych/commit/939754237f
2019-07-25 07:47:07 +09:00
Jeremy Evans 9095ff53cf [ruby/date] Describe what is meant by valid in the Date.valid_date? rdoc
https://github.com/ruby/date/commit/8eca79d1f0
2019-07-22 17:36:20 +09:00
Nobuyoshi Nakada 8deabcd328
Constified afamily functions 2019-07-16 18:42:56 +09:00
Nobuyoshi Nakada 75fb0a9afa
Allow mday in Date.iso8601 to be omitted
[Bug #12285]
2019-07-16 09:41:23 +09:00
Koichi Sasada 223854ebe8 catch up e8ddbc0239. 2019-07-15 09:58:26 +09:00
Yusuke Endoh deb5e58230 ext/stringio/stringio.c (strio_read): "binray" is always zero here
Remove unused conditional expression to suppress Coverity Scan warnings.
2019-07-15 00:20:32 +09:00
Yusuke Endoh 80da68db1e Add a /* fall through */ comment 2019-07-14 23:36:23 +09:00
Tanaka Akira 4900a10689 socket: use frozen string buffer when releasing GVL
Thanks for the patch by normalperson (Eric Wong) [Bug #14204].
2019-07-14 20:46:51 +09:00
Nobuyoshi Nakada 715955ff27
Include ruby/assert.h in ruby/ruby.h so that assertions can be there 2019-07-14 17:58:03 +09:00
Nobuyoshi Nakada 32f0135144
Split RUBY_ASSERT and so on under include/ruby 2019-07-14 17:45:21 +09:00
Tanaka Akira 4d9504fe13 Delegates 3 arguments for Pathname.glob.
Thanks for the patch by pocke (Masataka Kuwabara) [Feature #14405].
2019-07-14 17:42:58 +09:00
Nobuyoshi Nakada dcb8c41a1e
Added depend files 2019-07-14 01:31:29 +09:00
Nobuyoshi Nakada 331eccf3fe
Removed useless `freeze`s from gemspec files 2019-07-13 07:25:54 +09:00
Nobuyoshi Nakada fd9f26df00
Drop fossil rubygems support 2019-07-13 07:25:54 +09:00
Nobuyoshi Nakada 143581cf4e
Removed stub lines from gemspec files 2019-07-13 07:25:51 +09:00
Nobuyoshi Nakada 1ee17782e1
Removed binary line 2019-07-13 06:09:33 +09:00
Nobuyoshi Nakada 8745fa2ff0
Default to true when no exception flag [Bug #15987] 2019-07-11 21:05:25 +09:00
Nobuyoshi Nakada f74e23af32
Fixed argument in the fallback function [Bug #15987] 2019-07-11 20:21:50 +09:00
Nobuyoshi Nakada c2723e59c2
Removed wrong argument in the fallback function [Bug #15987] 2019-07-11 20:20:02 +09:00
Nobuyoshi Nakada 3e7d002118
Check exception flag as a bool [Bug #15987] 2019-07-11 20:04:29 +09:00
Nobuyoshi Nakada 1d2ec4b216
Added Etc::VERSION 2019-07-10 12:33:29 +09:00
Nobuyoshi Nakada 612b7b6224
Removed unused files 2019-07-10 12:32:35 +09:00
Nobuyoshi Nakada cc936402eb
C90 for old versions 2019-07-10 03:02:01 +09:00
Nobuyoshi Nakada de4889ce5c
Use the found version number 2019-07-10 02:07:42 +09:00
Nobuyoshi Nakada 9c48472b1e
Removed useless `freeze`s 2019-07-10 01:57:18 +09:00
Nobuyoshi Nakada db844749af
Added StringIO::VERSION 2019-07-10 01:21:05 +09:00
Nobuyoshi Nakada d905ff61e6
Update dependencies 2019-07-09 13:47:07 +09:00
Nobuyoshi Nakada 2a8be8ec33
Suppress uninitialized instance variable warnings 2019-07-09 08:31:27 +09:00
Lourens Naudé 612cad5d20
Let struct dump_config in objspace fit in a single cache line
Let dump_config boolean members roots and full_heap be bit flags
instead

Closes: https://github.com/ruby/ruby/pull/2274
2019-07-08 13:30:21 +09:00
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