1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

50444 commits

Author SHA1 Message Date
mame
2de0c72947 test/test_tempfile.rb: close a file object created by Tempfile.create
To stop a "Leaked file descriptor" warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 15:26:11 +00:00
mame
85bcd2b35f bignum.c: Bignum#fdiv avoids double division when divisor is bignum
`Rational(int, bignum).to_f` sometimes returned a wrong result because
`Bignum#div` casted its divisor to double.  [Bug ] [ruby-core:86330]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 14:02:59 +00:00
k0kubun
ab73022cb2 mjit_compile.c: disable stack consistency check
This should be basically safe because VM already does this check.
I don't think JIT-ed code, which should be specially optimized, should
still do this.

* Benchmark

Calculating -------------------------------------
                         before  before,--jit  after,--jit
           optcarrot     53.851        68.050       71.641 fps

Comparison:
                        optcarrot
         after,--jit:        71.6 fps
        before,--jit:        68.1 fps - 1.05x  slower
              before:        53.9 fps - 1.33x  slower

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 13:17:01 +00:00
nobu
c2007e191b iseq.c: indent iseq dump
* iseq.c (rb_iseq_disasm): indent catch_table iseq entries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 11:00:39 +00:00
ko1
51d227e3a5 refactoring r63073.
* cont.c (root_fiber_alloc): call `ConvertThreadToFiber()` here.

  `rb_fiber_t` for root_fiber is allocated before running Threads.
  Fiber objects wrapping this rb_fiber_t for root_fiber are created
  when root Fiber object is required explicitly (for example, Fiber
  switching and so on). We can put calling `ConvertThreadToFiber()`.
  In other words, we can pending `ConvertThreadToFiber()`
  until Fiber objects are created.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 08:19:28 +00:00
yui-knk
746a88e199 gc.c: Fix a typo
Pointed by hkdnet <satoko.itse@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 07:46:06 +00:00
kou
e440bfaed1 rexml: Fix a XPath bug of /child::node()
[Bug ]
    
* lib/rexml/xpath_parser.rb: Fix a bug that "/child::node()" returns
  XML declaration and text nodes out of root element.

* test/rexml/test_jaxen.rb: Enable more tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 06:53:57 +00:00
kou
478d3dffa2 rexml: Add codes for debugging XPath logic
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 06:51:07 +00:00
kou
1d6ca665f5 rexml: Fix a XPath bug of function()/path
[Bug ]
    
* lib/rexml/functions.rb: Fix a bug that "function()/path" always returns
  nothing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 06:36:06 +00:00
ko1
c563210532 use Queue for inter-thread synchronization.
* test/ruby/test_bignum.rb (test_interrupt_during_to_s): should not use
  "while" synchronization, but should use Queue.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 05:00:52 +00:00
nobu
5ff72d0569 iseq.c: strip trailing spaces in dump
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 04:28:47 +00:00
kou
b537823f3d rexml: Fix a XPath bug of @attribute/parent
[Bug ]
    
* lib/rexml/functions.rb: Fix a bug that "@attribute/parent" doesn't
  return element of its attribute.

* test/rexml/test_jaxen.rb: Enable more tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 03:27:20 +00:00
kou
d050a28f76 rexml: Fix a XPath bug of $variable
[Bug ]
    
* lib/rexml/functions.rb: Fix a bug that "$variable" returns
  node instead of ndoe set.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-04 03:26:01 +00:00
nobu
c79307c0dc test_fiber.rb: fix test_create_fiber_in_new_thread
* test/ruby/test_fiber.rb (test_create_fiber_in_new_thread):
  prefix to run, and get the result value not only waiting.
  [Bug ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 16:54:27 +00:00
nobu
9ba849e631 Fix typo
[Bug ]
[Fix GH-1855]

From: MSP-Greg <MSP-Greg@users.noreply.github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 16:50:17 +00:00
kou
c592ce4023 rexml: Fix a XPath bug of name(node-set)
[Bug ]
    
* lib/rexml/functions.rb: Fix a bug that "name(node-set)" returns
  element instead of element name.
  
* test/rexml/test_jaxen.rb: Enable more tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 15:51:08 +00:00
svn
a03e6e5e28 * 2018-04-04
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 15:42:01 +00:00
k0kubun
bc34d92f3d mjit.c: add class serial of singleton class
for toplevel self.

Toplevel self's class is not `Object` but `#<Class:Object>`.
This commit allows to inline method call setup for toplevel methods.
I've thought r63053 works but it doesn't...

I actually want to add all singleton classes but I'm not sure what's the
good way for it. I assumed that using ObjectSpace.each_object is suboptimal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 15:42:00 +00:00
nobu
7f30b84c4f adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 11:27:00 +00:00
nobu
02df45c4c4 Reproducible test for [Feature#14370] @ [Bug ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 10:50:47 +00:00
ko1
1751ea76a4 repatch r62966 and r62969.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 10:22:45 +00:00
ko1
db3cc675f3 Fix Fiber with Thread issue on Windows [Bug ]
* cont.c (rb_threadptr_root_fiber_setup): divide into two functions:
  * rb_threadptr_root_fiber_setup_by_parent(): called by the parent thread.
  * rb_threadptr_root_fiber_setup_by_child(): called by the created thread.

  `rb_threadptr_root_fiber_setup()` is called by the parent thread and
  set fib->fib_handle by ConvertThreadToFiber() on the parent thread on
  Windows enveironment.
  This means that root_fib->fib_handle of child thread is initialized
  with parent thread's Fiber handle. Furthermore, second call of
  `ConvertThreadToFiber()` for the same thread fails.

  This patch solves this weird situateion. However, maybe we can make more
  clean code.

* thread.c (thread_start_func_2): call
  `rb_threadptr_root_fiber_setup_by_child()` at thread initialize routine.

* vm.c (th_init): call `rb_threadptr_root_fiber_setup_by_parent()`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 10:21:47 +00:00
nobu
c3da162596 Honor --silent option
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 08:29:51 +00:00
nobu
e8b536c7e7 Fixed unmatched quotes and brackets
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 08:29:50 +00:00
nobu
f687794964 adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 08:10:32 +00:00
naruse
0c632c6fd3 Revert r62966 and r62969
It breaks mswin's test-all

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 07:54:18 +00:00
nobu
60f0e763a4 proc.c: fix segfault when no singleton class
* proc.c (rb_obj_singleton_method): bail out if the receiver does
  not have the singleton class without accessing the origin class
  not to segfault.  [Bug ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 06:57:44 +00:00
nobu
c7770f90bd Fix Kernel#singleton_method with Module#Prepend
* proc.c (rb_obj_singleton_method): search the method entry from
  the origin class, for fix prepended modules.  [Bug ]

From: Vasiliy Ermolovich <younash@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 06:57:43 +00:00
nobu
5bcb76ebbd removed never used variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 06:25:10 +00:00
svn
577d258eba * 2018-04-03
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 05:56:17 +00:00
hsbt
375cd7079f Support upstream directory structure for ruby/csv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-03 05:56:16 +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
bae19b5547 error.c: prepend "warning: " always
* error.c (rb_warn_m): prepend the string "warning: " if uplevel
  keyword is given, even if caller file and line information are
  not available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-02 11:39:10 +00:00
nobu
f961bad191 Improve mkmf error message
* lib/mkmf.rb: Improve the error message when ruby.h is missing,
  to suggest installing separate packages.  [Feature ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-02 04:44:35 +00:00
nobu
e6d7389c2b Keep feature names loaded in the block
* lib/rubygems/test_case.rb (Gem::TestCase#save_loaded_features):
  keep feature names for rubygem libraries loaded in the block.
  c.f. 

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-02 04:20:07 +00:00
nobu
5c7e7846b8 Fix typo on URI.hierarchical? [ci skip]
* lib/uri/generic.rb (hierarchical?): [DOC] Fix typo in the
  description.  [Fix GH-1851]

From: Harry Llewelyn <advocation@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-02 03:30:30 +00:00
svn
5896936f2c * 2018-04-02
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 16:17:53 +00:00
kou
f0c734660f Start re-enabling Jaxen tests
[Bug ]
Reported by MSP-Greg. Thanks!!!

* lib/rexml/xpath_parser.rb: Fix a bug that "following_siblings::*[N]"
  doesn't work.

* test/rexml/test_jaxen.rb: Enable only axis test for now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 16:17:52 +00:00
nobu
a0e6607a81 test_time_tz.rb: Lisbon tzdata fix
* test/ruby/test_time_tz.rb (gen_variational_zdump_test): Update
  Lisbon zdump data, which fixed the 1912-01-01 transition for
  Portugual and its colonies.  [Bug ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 13:16:14 +00:00
nobu
584b5929f9 test_time_tz.rb: Kiritimati tzdata fix
* test/ruby/test_time_tz.rb (gen_zdump_test): fix the expected
  data at the Kiritimati's skip of New Year's Eve 1994.
  [Bug ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 13:02:11 +00:00
nobu
2965c2d4df test_time_tz.rb: Kiritimati tzdata fix
* test/ruby/test_time_tz.rb (TestTimeTZ#test_pacific_kiritimati):
  fix the expected data at the skip of New Year's Eve 1994.
  [Bug ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 02:00:36 +00:00
k0kubun
fcc5957241 mjit.c: make Object's class serial valid in JIT
Without this change, we couldn't inline method call setup for methods
which are defined in the top level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-01 01:41:55 +00:00
svn
abb19b13ee * 2018-04-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 15:48:59 +00:00
nobu
baabfa3fa2 compile.c: compile_evstr
* compile.c (compile_evstr): extract from iseq_compile_each.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 15:48:59 +00:00
nobu
6b346a7c85 compile.c: end_label
* compile.c (compile_if): branch to end_label is not used if
  else_seq is not used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 15:48:57 +00:00
naruse
d3d40e99f1 Resurvey performance of RDoc by frozen_string_literal: true [Bug ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 13:48:32 +00:00
nobu
36b6f5cc12 use requrie_relative
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 11:11:31 +00:00
nobu
16c0e1711c use require_relative
* spec/ruby/core/file/ftype_spec.rb: use require_relative which
  resolves symbolic links consistently to git rid of constant
  re-definition warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 10:34:16 +00:00
nobu
40e9437267 file_types.rb: use the current terminal device
* spec/ruby/core/file/fixtures/file_types.rb (configure_types):
  try the current standard input terminal device first to get rid
  of a race condition.  other terminal devices may be used by
  other processes and disposed during the test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 06:05:04 +00:00
kazu
d0775a1120 test/lib/leakchecker.rb: Add check_verbose
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-31 02:29:19 +00:00