* win32/win32.c (filetime_split, clock_gettime): keep the
precision as possible as the FILETIME format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/intern.h (rb_fd_select): turned into an inline
function, to suppress -Waddress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* random.c (fill_random_seed): do not need to be secure, to get
rid of blocking at the start-up time.
[ruby-core:87462] [Bug #14837]
* random.c (random_raw_seed): expected to be a cryptographically
secure, as documented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When an empty rule or a mid-rule action is reduced,
`YYLLOC_DEFAULT` is called with the third parameter to be zero.
If we use `RUBY_SET_YYLLOC_OF_NONE` to set their locations,
sometimes the end position of NODE indicates a blank.
For example, `a.b ;` generates `NODE_CALL (line: 1, location: (1,0)-(1,4))*`,
whose end position indicates a blank.
This is because of the following reasons:
* `NODE_CALL` is created when `primary_value call_op operation2 opt_paren_args` is
reduced to `method_call`.
* `opt_paren_args` is `none`.
* `yylex` is called and `lex.pbeg` moves before `none` is reduced, so
the beginning position of `none` does not match with the end position of `operation2`.
To fix locations, use `YYRHSLOC(Rhs, 0)` in `YYLLOC_DEFAULT`
(0 "refers to the symbol just before the reduction").
By this change, the bottom of the location stack would be referenced,
so initialize the bottom with `RUBY_SET_YYLLOC_OF_NONE` in `%initial-action`.
Ref: https://www.gnu.org/software/bison/manual/html_node/Location-Default-Action.html#Location-Default-Action
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_bodystmt): Fix locations of NODE_RESCUE
to end with nd_else or nd_resq. Before this commit,
locations of NODE_RESCUE included locations of nd_ensr
of NODE_ENSURE which is a parent node of NODE_RESCUE.
e.g. The location of the end of NODE_RESCUE is fixed:
```
def a
:b
rescue
:c
ensure
:d
end
```
* Before
```
NODE_RESCUE (line: 2, location: (2,2)-(6,4))
```
* After
```
NODE_RESCUE (line: 3, location: (2,2)-(5,0))
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit 9d015aa91cc3ec45e41be58fd836fb7f6655a624.
Because tool/extlibs.rb runs with BASERUBY that may be ruby < 2.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ast.c (node_children): fix the member for method IDs as nd_mid.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Document about optional getline arguments
* Add examples, especially for the demonstration of `chomp: true`
[Fix GH-1886]
From: Koki Takahashi <hakatasiloving@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ast.c: Fix to raise `SyntaxError` when `RubyVM::AST.parse`
or `RubyVM::AST.parse_file` fail to parse input.
* test/ruby/test_ast.rb: Add test cases for invalid syntax.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The upstream repository is https://github.com/ruby/matrix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This test is about write_timeout.
To ensure it really raised Net::WriteTimeout, skip this test on Windows,
whose write returns immediately even for large data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/net/http/test_http.rb (test_timeout_during_HTTP_session_write): on some
platforms such as Windows immediately returns from Socket#write, and have to
wait to read its response. So, we can not handle Net::WriteTimeout and should
handle Net::ReadTimeout instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Nobody uses it, and "git log -p -Scached_const" shows it's ever
been used in public history.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The current VM_INSTRUCTION_SIZE is 198, so the linear search
painful during a major GC phase.
I noticed rb_vm_insn_addr2insn2 showing up at the top of some
profiles while working on some malloc-related stuff, so I
decided to attack it.
Most notably, the benchmark/bm_vm3_gc.rb improves by over 40%:
https://80x24.org/spew/20180602220554.GA9991@whir/raw
[ruby-core:87361] [Feature #14814]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Some comments say "stop", others say "finish".
I'm going to add code which dynamically stops MJIT worker, rather than
finishing it forever. So I'm thinking `stop` is more appropreate for it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c (math_cbrt): refine the approximation result on boundary
values by an iteration of Newton-Raphson method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
`Net::HTTPServerException` has been deprecated since r63590. [Bug #14688]
And `net/http/responses.rb` uses the deprecated constant, so Ruby warns of the deprecation.
Example:
```bash
$ ruby -r net/http -e ''
/home/pocke/.rbenv/versions/trunk/lib/ruby/2.6.0/net/http/responses.rb:22: warning: constant Net::HTTPServerException is deprecated
```
This change suppresses the warning.
From: Masataka Pocke Kuwabara <kuwabara@pocke.me>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e