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

7297 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 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