59253 Commits

Author SHA1 Message Date
Antonio Terceiro
ed5d032ea3 debug.rb: expand filenames in breakpoints
When debugging some local code, specifying a breakpoint to a local
filename does not work, i.e.

    break lib/foo.rb:10

Expanding the filename makes it work. FWIW byebug has the same behavior.
2019-12-05 13:28:34 +09:00
aycabta
20031f8b74 Change encoding of completion list 2019-12-05 13:06:18 +09:00
Alan Wu
df76f2c577
Make TracePoint.stat a singleton method again (#2726)
[Bug #16399]
2019-12-04 21:02:21 -05:00
Jeremy Evans
e4db0443bc Make rb_eval_string_wrap specify a cref so constant setting works correctly
Fixes [Bug #10466]
2019-12-05 03:04:38 +02:00
Yuki Nishijima
18d3b5a93a Do not attempt to call methods on the receiver if it is a basic object 2019-12-04 19:55:01 -05:00
Kazuhiro NISHIYAMA
88ee375dd6
Revert "Add debug option to check ci failures on solaris"
This reverts commit f289e3994bbc6560e2e4e5905b52c35c829c972d.
2019-12-05 09:44:09 +09:00
git
fbf10ed5b3 * 2019-12-05 [ci skip] 2019-12-05 09:03:49 +09:00
aycabta
e3587ed849 Support disable-completion 2019-12-05 09:02:23 +09:00
aycabta
ad8fbf444a Fix variable catch 2019-12-05 09:02:23 +09:00
Nobuyoshi Nakada
fb11e6089d
[DOC] Added File::FNM_SYSCASE example [Bug #16391] [ci skip] 2019-12-04 21:52:29 +09:00
Yusuke Endoh
dbfd4b780e coroutine/ucontext/Context.c: Include "ruby/config.h" for Solaris
getcontext, makecontext, and swapcontext seem to be available only when
`__EXTENSION__` is defined on Solaris.
2019-12-04 20:59:39 +09:00
Kazuhiro NISHIYAMA
a0bc0e1ba1 Fix thread leak in drb 2019-12-04 20:57:24 +09:00
卜部昌平
00bbdf4451 implement Range#count
As matz requested in [Bug #16366].
2019-12-04 15:32:49 +09:00
Koichi Sasada
c6e3db0c66 new_cond before mon_initialize
MonitorMixin#new_cond can be called before mon_initialize, so we
need to initialize `@monitor` before it.

https://bugs.ruby-lang.org/issues/16255#note-4
2019-12-04 13:36:41 +09:00
Yusuke Endoh
f9e5c74cd2 compile.c: stop wrong peephole optimization when covearge is enabled
jump-jump optimization ignores the event flags of the jump instruction
being skipped, which leads to overlook of line events.

This changeset stops the wrong optimization when coverage measurement is
neabled and when the jump instruction has any event flag.

Note that this issue is not only for coverage but also for TracePoint,
and this change does not fix TracePoint.
However, fixing it fundamentally is tough (which requires revamp of
the compiler).  This issue is critical in terms of coverage measurement,
but minor for TracePoint (ko1 said), so we here choose a stopgap
measurement.

[Bug #15980] [Bug #16397]

Note for backporters: this changeset can be viewed by `git diff -w`.
2019-12-04 10:40:54 +09:00
Nobuyoshi Nakada
5a404efd29 [ruby/io-console] Fixed intr: false mode on Windows
https://github.com/ruby/io-console/commit/4c172c01aa
2019-12-04 10:10:45 +09:00
Jeremy Evans
447d583536 Silence incorrect assigned but unused variable warnings in ripper
To only emit the warnings in correct cases would require tracking
local variable usage in ripper, which ripper currently does not do.

Fixes [Bug #15188]
2019-12-04 03:04:22 +02:00
Jeremy Evans
a91637c516 Make {Method,UnboundMethod}#super_method handle clone/bind/unbind
This wasn't working previously because the iclass entry wasn't
being copied, and without an iclass entry, super_method returns
nil.

Fixes [Bug #15629]
2019-12-04 01:35:34 +02:00
Yusuke Endoh
f9754f0ea0 compile.c: trivial refactoring
Use `for` instead of `while` to make it explicit that it is a traverse
of bytecode.
2019-12-04 08:22:48 +09:00
NARUSE, Yui
8852fa8760 Revert "Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)"
This reverts commit 2a22a6b2d8465934e75520a7fdcf522d50890caf.
Revert [Feature #13083]
2019-12-04 06:40:54 +09:00
NARUSE, Yui
08074eb712 Revert "Revert nil error and adding deprecation message"
This reverts commit 452bee3ee8d68059fabd9b1c7a75661b14e3933e.
2019-12-04 06:40:54 +09:00
NARUSE, Yui
a705f6472c Revert "Improve warning message"
This reverts commit 31110d820cc1258cbc84b46ecc65b254c7d5529a.
2019-12-04 06:40:54 +09:00
NARUSE, Yui
34a66b1f36 Revert "Fix warnings in Regexp#{match,match?} specs"
This reverts commit 782d1b8fb0a039cedef9ad9c94f432dad51901e6.
2019-12-04 06:40:54 +09:00
Jeremy Evans
a029b54ec7 Make Enumerator::Chain#each treat lambdas as lambda
Previously, lambdas were converted to procs because of how
rb_block_call works.  Switch to rb_funcall_with_block, which
handles procs as procs and lambdas as lambdas.

Fixes [Bug #15613]
2019-12-03 23:18:28 +02:00
Jeremy Evans
47c97e1e84 Do not lose existing constant visibility when autoloading
This copies the private/deprecate constant visibility across the
autoload.  It still is backwards compatible with setting the
private/deprecate constant visibility in the autoloaded file.
However, if you explicitly set public constant in the autoloaded
file, that will be reset after the autoload.

Fixes [Bug #11055]
2019-12-03 17:31:49 +02:00
git
b96d559c69 * 2019-12-04 [ci skip] 2019-12-04 00:27:58 +09:00
Jeremy Evans
5c2c396685 Check interrupts before starting thread
Fixes a hang when Thread.new calls Thread.new in a loop.

Fixes [Bug #13688]
2019-12-03 17:27:34 +02:00
KOSAKI Motohiro
7f2cd2ae6f fix typo 2019-12-03 10:50:16 +00:00
Yusuke Endoh
a1f98cd4c1 vm_args.c: make the keyword deprecation message helpful
```
$ ./miniruby -e 'def foo(kw: 1); end; h = {kw: 1}; foo(h)'
-e:1: warning: The last argument is used as the keyword parameter
-e:1: warning: for `foo' defined here; maybe ** should be added to the call?
```
2019-12-03 17:56:50 +09:00
Yusuke Endoh
409e4ab740 tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message:
"undefined method `write' for nil:NilClass" due to lack of stdout.

This change makes it explicit.  [Bug #5577]
2019-12-03 17:26:12 +09:00
Nobuyoshi Nakada
e42d9d8df8
Fixed the inverted condition 2019-12-03 14:51:14 +09:00
Nobuyoshi Nakada
9165fcdfa3
Wrap statements in AS_IF properly 2019-12-03 14:46:54 +09:00
aycabta
027e847cd2 Fix auto-indent behavior correctly 2019-12-03 13:02:50 +09:00
Nobuyoshi Nakada
14a17063a1
Fixed stack overflow [Bug #16382]
Get rid of infinite recursion in expanding a load path to the real
path while loading a transcoder.
2019-12-03 08:51:50 +09:00
Yusuke Endoh
8bddf1bc9b mjit.c: fix a mismatch of malloc'ed type
Coverity Scan found this issue.
2019-12-03 08:02:38 +09:00
Benoit Daloze
424ad9a493 Make more attempts to check for the precision of Process.times
* Process.clock_getres specs use 10_000 but that's quite slow for
  the Process.times spec.
2019-12-02 21:23:10 +01:00
git
c688487fae * 2019-12-03 [ci skip] 2019-12-03 01:41:22 +09:00
aycabta
a92560132b Support incremental search by last determined word
In the incremental search by C-r, search word is saved when it's determined. In
the next incremental search by C-r, if a user presses C-r again with the empty
search word, the determined previous search word is used to search.
2019-12-03 01:39:59 +09:00
aycabta
bce38f706e The C-r in vi command mode is also incremental search 2019-12-03 01:39:59 +09:00
Takashi Kokubun
a47d6c256f
Fix random failure on getusage-missing environments
`* 1e6` makes a spurious result about floating point number's precision.

```
irb(main)[01:0]> 16.028
=> 16.028
irb(main)[02:0]> (16.028 * 1e6)
=> 16027999.999999998
```
2019-12-02 00:17:41 -08:00
Kazuhiro NISHIYAMA
1a88adcd75 Fix Leaked file descriptor in test/did_you_mean
de74d2c3b0/checks (step):19:131
```
Leaked file descriptor: NameErrorExtensionTest#test_correctable_error_objects_are_dumpable: 7 : #<File:test_name_error_extension.rb>
```
2019-12-02 16:25:43 +09:00
Takashi Kokubun
185f760873
Debug random failure of ruby-spec on ci.rvm.jp 2019-12-01 23:23:40 -08:00
Nobuyoshi Nakada
9afaf139f2
Revert "builtin_binary.inc needs miniruby itself for RubyVM.each_builtin"
This reverts commit 2615030c521afc822c66a7e139ccba3d2365ab56,
which doesn't work when cross compiling, except for mingw.
2019-12-02 14:15:42 +09:00
Nobuyoshi Nakada
2615030c52
builtin_binary.inc needs miniruby itself for RubyVM.each_builtin 2019-12-02 14:03:57 +09:00
Nobuyoshi Nakada
a7b9f085ff
Disable _FORTIFY_SOURCE on mingw for now
It causes a link error due to some `__*_chk` functions on mingw.
2019-12-02 13:20:00 +09:00
Nobuyoshi Nakada
b1c92363a7
Wait for the main thread to start reading by Queue
Otherwise, the written data to pty before the reading started may
be just lost.
2019-12-02 13:17:05 +09:00
Takashi Kokubun
de74d2c3b0
Simplify variable declaration by C99 2019-12-01 17:32:50 -08:00
aycabta
103b04128f Support incremental search again by C-r in incremental search 2019-12-02 04:18:22 +09:00
Takashi Kokubun
b3ea0980db
Check MJIT support in one place
to fix test failure on trunk-no-mjit
https://gist.github.com/ko1/32ab982ffd7555988818773c08f97123
2019-12-01 10:53:59 -08:00
Takashi Kokubun
6bc8b4d8ea
Skip --jit-debug= test on mswin
it fails like
https://ci.appveyor.com/project/ruby/ruby/builds/29235837/job/v0apdjj4qx8afars
2019-12-01 10:51:05 -08:00