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

46306 Коммитов

Автор SHA1 Сообщение Дата
eregon 413cece5c9 no longer rescue exceptions of #coerce in Integer#step
* numeric.c (num_step_negative_p): no more error hiding.
* test/ruby/test_float.rb, test/ruby/test_numeric.rb:
  follow the change. [Feature #7688]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 11:42:31 +00:00
eregon bc1827e882 no longer rescue exceptions in numeric comparison operations
* numeric.c (do_coerce): no more error hiding.
* test/ruby/test_numeric.rb: follow the change.
  [Feature #7688]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 11:42:20 +00:00
hsbt 33f66084d5 Import gemspec
Import gemspec and test file from ruby/webrick.

  * webrick.gemspec: Update files and dependency for standalone gem.
  * test/webrick/utils.rb: Added explicitly loading of EnvUtil for
    test suite without ruby core test suite.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 09:23:04 +00:00
eregon 905d52772c Document the Warning module and warn method
* error.c (Warning): add documentation. [Feature #13504]
  Author: Jeremy Evans <code@jeremyevans.net>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 09:10:46 +00:00
nobu 5ad56e7c0b load.c: backtrace of circular require
* load.c (load_lock): print backtrace of circular require via
  `Warning.warn` [ruby-core:80850] [Bug #13505]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 08:17:24 +00:00
hsbt 0adeb1c8ab Import gemspec and test file changes from ruby/gdbm.
* gdbm.gemspec: Update basic configuraiton for standalone gdbm gem.
  * test/gdbm/test_gdbm.rb: In standalone environment, It needs to
    explicit loading of EnvUtil module for test suite.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 07:55:56 +00:00
svn 3c7785451e * 2017-04-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 06:51:35 +00:00
shyouhei 766864166f fix macro expansion bug
This previous "key" macro argument accidentally replaced `(ptr)->key` part. 


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 06:51:34 +00:00
nobu 4cf6302d9d tool/git-refresh: fix branch operations
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-24 11:52:14 +00:00
nobu 80f5067478 parse.y: args tail at error
* parse.y (new_args_tail_gen): abandon parsing arguments after
  error.  reported by ilsani Martino Sani (ilsani) at
  https://hackerone.com/reports/221201

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-24 06:17:55 +00:00
nobu 7c23609e60 parse.y: rb_parser_fatal
* parse.y (rb_parser_fatal): abort compilation on internal parser
  error.  rb_bug() is generic use but not useful for debugging the
  parser.  this function dumps internal states, and continues with
  enabling yydebug output to stderr for the parser stack dump.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-24 06:17:54 +00:00
nobu 5b3c9fc962 Get rid of unnecessary GCC extension
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-24 04:20:02 +00:00
shyouhei a15fd1d9f2 revert newhash refactoring
We need to fix GC bug before merging this.  Revert revisions
58452, 58435, 58434, 58428, 58427 in this order.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-24 01:40:51 +00:00
svn b3209c258e * 2017-04-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 16:19:23 +00:00
naruse c7ec1b1f59 Allow Net::HTTP to fetch user/pass from http_proxy
Note that this feature is enabled only on environment variables are
multi-user safe. In this time the list includes Linux, FreeBSD, or
Darwin. [Bug #12921]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 16:19:23 +00:00
naruse ece9698d73 suppress warning: shadowing outer local variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 16:19:22 +00:00
nobu 93955c7560 Add diagnostic reports section header [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 14:51:08 +00:00
nobu 8284de591f assert_syntax_error returns the exception [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 14:47:31 +00:00
nobu 0ae219f0e1 Document parse.y instead of ext/ripper/ripper.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 01:31:37 +00:00
nobu 9778c8da91 ext/dl has been removed already [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 01:31:36 +00:00
nobu 41e6fd8931 use $(srcdir).
* win32/Makefile.sub (enc/jis/props.h): build it in not builddir,
  but in srcdir.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 01:23:30 +00:00
nobu be7309ddf6 Refactor "%f" % Inf/NaN
* sprintf.c (rb_str_format): as for non-finite float, calculate
  the exact needed size with the space flag.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 01:04:40 +00:00
nobu 6f8f950cc3 Fix space flag when Inf/NaN and width==3
* sprintf.c (rb_str_format): while `"% 2f"` and `"% 4f"` result in
  `" Inf"` and `" Inf"` respectively, `"% 3f"` results in
  `"Inf"` (no space).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 01:04:39 +00:00
ko1 a6f0ec21e9 mark Hash keys correctly.
* hash.c (rb_hash_new_from_object): same as r58434.
  Newly created frozen objects are not referred from any roots/objects.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 00:20:27 +00:00
nobu 3aa95e7846 Ignore enc/jis/props.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 16:26:15 +00:00
svn aeb7f801a0 * 2017-04-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 16:19:13 +00:00
stomar fe378f03f7 test/test_prime.rb: update method name in comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 16:19:12 +00:00
nobu 27ed9f1d29 parse.y: fix compile_error format
* parse.y (ripper_compile_error, parser_compile_error): declare as
  PRINTF_ARGS attribute.

* parse.y (id_is_var_gen): fix format specifier for string value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 08:32:33 +00:00
nobu 9c5c31c8b7 test_file_exhaustive.rb: check case-sensitive fs
* test/ruby/test_file_exhaustive.rb (test_expand_path): dump
  expanded file name, not only appended char, for case-sensitive
  filesystem.  [ruby-dev:50093] [Bug #13489]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 08:19:34 +00:00
nobu 0749e7be45 adjust indent
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 08:19:33 +00:00
kazu 8baadf66d4 Remove nonexistent files and rename some files
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 02:04:35 +00:00
normal 7e5462b36f define PACKED_STRUCT_UNALIGNED correctly
Defining PACKED_STRUCT_UNALIGNED to a noop in ruby/config.h (via
`configure') prevents the definition in include/ruby/defines.h
from working

This should have been fixed in r46914, so there's a size
regression for some objects since Ruby 2.2+.  I do not believe
we can backport to existing releases, either, since it can
affect ABI.

Add a test for Time objects on common x86-based platforms to
check for future regressions.

* configure.in: remove PACKED_STRUCT_UNALIGNED definition
* test/ruby/test_time.rb (test_memsize): new test for x86

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 01:08:15 +00:00
nobu 966bfb07f6 Add sha512
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 00:27:14 +00:00
nobu ee691feac8 Update sources and include files after update
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 00:18:08 +00:00
ko1 9e1ab6cee4 use $(srcdir).
* Makefile.in (enc/jis/props.h): build it in not builddir, but in srcdir.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 00:10:28 +00:00
nobu d97f700938 clean autogenerated files
* enc/depend (clean, clean-srcs): fix path of name2ctype.h, and
  remove casefold.h too.

* enc/jis/props.h: autogenerated file.
  [ruby-core:80823] [Bug #13493]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 23:16:43 +00:00
normal e79ecc540f test/socket/test_basicsocket: handle :wait_readable on read_nonblock
On some systems with slower local sockets, :wait_readable may
happen and we should wait on it to drain the socket.
This is a possible fix for https://bugs.ruby-lang.org/issues/13491

* test/socket/test_basicsocket.rb (test_read_write_nonblock):
  handle :wait_readable on read_nonblock

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 20:38:58 +00:00
svn 581c447ff9 * 2017-04-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 15:00:31 +00:00
ko1 5f5bc068ed insert WB correctly.
* hash.c (hash_insert_raw): should insert WB.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 15:00:30 +00:00
ko1 a7db632088 mark created frozen strings.
* hash.c (rb_hash_new_from_values_with_klass): before this fix,
  only a st table are filled with passed values. However, newly
  created frozen strings are not marked correctly only reference
  from st table. This patch marks such created frozen strings
  by Hash object which refers to the st table.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 11:02:10 +00:00
kazu 34f1488895 Remove empty directories
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 11:00:10 +00:00
hsbt 7a856b11c8 Removed mathn.rb from stdlib. It's deprecated from Ruby 2.2.
[Feature #10169][[ruby-core:64553]]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:16:11 +00:00
nobu 20d81b4287 test_framework.rb: for case-sensitive filesystem
* test/mkmf/test_framework.rb (test_single_framework): fix header
  file name for case-sensitive filesystem.  it may not be same as
  the framework name, but should be the actual file name.
  [ruby-dev:50093] [Bug #13489]

* test/mkmf/test_framework.rb (test_multi_frameworks): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:12:27 +00:00
rhe 70c9bb4b81 Remove missing/strtol.c
It is never used. We don't need it anyway as it's part of C89 which is
our current minimum requirement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:03:12 +00:00
shyouhei 16ffd47639 NEWS entry for [Feature #13302]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 05:35:34 +00:00
shyouhei 0c082fe658 typo fix (sorry!)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 04:42:09 +00:00
shyouhei 4ee09d914d refactor hash literal
Same as rb_ary_tmp_new_from_values(), it reduces vm_exec_core binary
size from 26,176 bytes to 26,080 bytes.  But this time, also with a
bit of optimizations:

  - Because we are allocating a new hash and no back references are
    introduced at all, we can safely skip write barriers.

  - Also, the iteration never recurs.  We can avoid complicated
    function callbacks by using st_insert instead of st_update.

----

	* hash.c (rb_hash_new_from_values): refactor
          extract the bulk insert into a function.

	* hash.c (rb_hash_new_from_object): also refactor.

	* hash.c (rb_hash_s_create): use the new functions.

	* insns.def (newhash): ditto.

	* vm.c (core_hash_from_ary): ditto.

	* iternal.h: export the new function.

-----------------------------------------------------------
benchmark results:
minimum results in each 7 measurements.
Execution time (sec)
name    before  after
loop_whileloop2  0.135  0.134
vm2_bighash*     1.236  0.687

Speedup ratio: compare with the result of `before' (greater is better)
name    after
loop_whileloop2 1.008
vm2_bighash*    1.798


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 04:21:14 +00:00
nobu bdc6d41640 ext/extmk.rb: colorize notes [Feature #13302]
* common.mk (build-ext): pass variables to colorize.

* ext/extmk.rb: colorize notes with tool/colorize.rb.

* tool/colorize.rb: extract from tool/generic_erb.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 03:01:12 +00:00
nobu 3ca61bb04e exts.mk: refine notes [Feature #13302]
* ext/extmk.rb: split notes into header and footer, which are
  common, from bodies which are unique for each extensions.

* template/exts.mk.tmpl: now each notes are not one line, should
  not unique.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 02:43:25 +00:00
nobu 5651313b85 vm_dump.c: non-scalar thread_id
* vm_dump.c (rb_vmdebug_stack_dump_all_threads): fix for
  non-scalar thread_id platforms.  c.f. [Bug #9884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 00:53:26 +00:00