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

45109 Коммитов

Автор SHA1 Сообщение Дата
nobu 5714a26b90 switching hash removal
* st.h (struct st_hash_type): Remove strong_hash.
  (struct st_table): Remove inside_rebuild_p and curr_hash.
* st.c (do_hash): Use type->hash instead of curr_hash.
  (make_tab_empty): Remove setting up curr_hash.
  (st_init_table_with_size): Remove setting up inside_rebuild_p.
  (rebuild_table): Remove clearing inside_rebuild_p.
  (reset_entry_hashes, HIT_THRESHOULD_FOR_STRONG_HASH): Remove code
  recognizing a denial attack and switching to strong hash.
* hash.c (rb_dbl_long_hash, rb_objid_hash, rb_ident_hash): Use
  rb_hash_start to randomize the hash.
  (str_seed): Remove.
  (any_hash): Remove strong_p and use always rb_str_hash for
  strings.
  (any_hash_weak, rb_any_hash_weak): Remove.
  (st_hash_type objhash): Remove rb_any_hash_weak.

based on the patch by Vladimir N Makarov <vmakarov@redhat.com> at
[ruby-core:78490].  [Bug #13002]

* test/ruby/test_hash.rb (test_wrapper): objects other than special
  constants should be able to be wrapped.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-06 04:43:48 +00:00
nobu 1e95f9da88 remove unnecessary variable
* st.c (do_hash): remove unnecessary variable and cast.

* hash.c, numeric.c, st.c: adjust style and indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-06 03:36:52 +00:00
nobu 1816e39351 random.c: pack hash seeds
* random.c (seed_keys_t, init_seed): pack seed for rb_hash_start and
  rb_memhash, and fill them at once.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-06 03:25:21 +00:00
svn 41a7549b8e * 2016-12-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-05 23:37:25 +00:00
shugo 1ac9b2ed5c Add a comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-05 23:37:25 +00:00
kazu b1272e93eb Remove closed checks and use `&.`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-05 12:35:03 +00:00
kazu 956aa0102e NEWS: mention chomp option of String and StringIO
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-05 12:35:02 +00:00
shugo 11f9b8c05c Don't insert an entry to loading_tbl if another thread succeed to load.
If rb_thread_shield_wait() returns Qfalse, the file has been successfully
loaded by another thread, so there is no need to insert a new entry into
loading_tbl.  [ruby-core:78464] [Bug #12999]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-05 11:10:05 +00:00
nobu 74ba0cfc62 random.c: private rand
* random.c (rb_random_ulong_limited): do not call private method
  rand.  [ruby-dev:49892] [Misc #13003]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-05 00:03:45 +00:00
svn 4509b36666 * 2016-12-05
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 23:14:47 +00:00
naruse cc2075cd17 Increase timeout of TestRequire#test_require_with_loaded_features_pop
unstable10s fails it because of timeout
http://rubyci.s3.amazonaws.com/unstable10s/ruby-trunk/log/20161201T161908Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 23:14:46 +00:00
nobu f5ef84cb5e class.c: missing unknown_keyword_error
* class.c (rb_get_kwargs): when values are stored, corresponding
  keys have been remove from the keyword hash, and the hash should
  be empty in that case.  [ruby-dev:49893] [Bug #13004]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 08:50:29 +00:00
nobu b62e322017 extension.rdoc: fix rb_get_kwargs [ci skip]
* doc/extension.rdoc: [DOC] optional keyword arguments are
  defaulted to Qundef.  ignored keys are kept in the hash but a
  new Hash is not created.  [ruby-dev:49893] [Bug #13004]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 08:50:28 +00:00
ktsj b16d1968e6 Revert changes on rb_frame_method_id_and_class()
r56593 introduced backwards incompatible changes in the API.
[ruby-core:78471] [Feature #12747]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 05:40:18 +00:00
shugo 7a5ad716d0 Specify the socktype explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 05:05:54 +00:00
shugo 94e8036b85 Use 127.0.0.1 if getaddrinfo fails.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 04:53:33 +00:00
duerst 8baa73be48 remove special processing for U+03B9/U+03BC/U+A64B
* enc/unicode.c: Remove special processing for U+03B9/U+03BC/U+A64B
  (GREEK SMALL LETTERs IOTA/MU, CYRILLIC SMALL LETTER MONOGRAPH UK)
  from onigenc_unicode_case_map and simplify code.

* enc/unicode/case-folding.rb: Remove check for U+03B9/U+03BC/U+A64B.

This and the previous few related commits make sure that we won't hit
the equivalent of bug #12990 anymore for future updates of Unicode versions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 01:58:54 +00:00
duerst 31fb4e3ec3 Reorder codepoints in some entries of CaseUnfold_11_Table
* enc/unicode/case-folding.rb: Reorder codepoints so that the upper-case
  mapping comes first.
* enc/unicode/9.0.0/casefold.h: Codepoints reordered, upper-case mapping
  flag added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 01:17:34 +00:00
svn 1fa8bd75a3 * 2016-12-04
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 15:41:15 +00:00
shugo 071d3ae301 Use IPv6 if it's preferred.
I hope this fix makes tests faster on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 15:41:14 +00:00
nobu d95f5bc81a string.c: chomp option
* string.c (rb_str_enumerate_lines): implement chomp option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 14:18:03 +00:00
kazu 9fa8006a01 Cleanup ruby method definitions in hash.c
Always add a space between a comma and the next element. These spaces
were there sometimes, but not always. This keeps to code consistent.

Patch by: Herwin Weststrate <herwin@snt.utwente.nl>

[ruby-core:78297] [Misc #12977] [GH-1492]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 11:18:44 +00:00
nobu 35623d779d stringio: chomp option
* ext/stringio/stringio.c (strio_getline): implement chomp option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 11:01:25 +00:00
nobu 856da5b407 test_stringio.rb: paragraph mode
* test/stringio/test_stringio.rb (test_gets, test_each):
  assertions for paragraph mode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 11:01:24 +00:00
duerst 0d2a4cc551 add tests againts regressions for upcoming codepoint reordering in unfolding table
* test/ruby/enc/test_case_mapping.rb: Add method test_reorder_unfold to test against
  problems when reordering codepoints in some entries in
  CaseUnfold_11_Type CaseUnfold_11_Table.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 07:18:41 +00:00
svn fc410343a1 * 2016-12-03
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 05:09:10 +00:00
duerst 56419df9f3 change test class name because it is not only about folding
* test/ruby/enc/test_case_comprehensive.rb: Change test class name from
  TestComprehensiveCaseFold to TestComprehensiveCaseMapping because the
  tests are about mapping in general, not only folding

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 05:09:09 +00:00
nobu 4a7c767ed2 test/ruby/test_string.rb: ensure restoring $/
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-02 06:12:56 +00:00
nobu 8130ee5c9d parse.y: simplify parsing utf-8 string
* parse.y (parser_tokadd_codepoint): move error checks and add
  char.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-02 03:33:54 +00:00
nobu 80045bc2a9 parse.y: relax spaces
* parse.y (parser_tokadd_utf8): relax restriction spaces inside
  "\u{...}".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-02 02:47:11 +00:00
rhe 76bb017ad2 re.c: count associated Regexp object in MatchData#hash
Don't discard the hash value computed for the regexp object. It seems it
was simply missed out in r24754, when MatchData#hash was initially
implemented.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-02 02:24:45 +00:00
svn cf3ff02e9c * 2016-12-02
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 17:43:42 +00:00
naruse 7e1b5d8d4f Remove unused variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 17:43:41 +00:00
naruse 306f43acfe String#unpack1 [Feature #12752]
Returns the first value of String#unpack.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 14:18:32 +00:00
usa b6e137e93c Remove `offset:` from `Array#pack`
* pack.c (pack_pack): can use `@` instead of `offset:`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 13:20:47 +00:00
usa 0dd9c302d9 Supports `buffer` and `offset` in `Array#pack`
* pack.c (pack_pack): Supports `buffer` and `offset` in `Array#pack`.
  [Feature #12754] [ruby-dev:49798]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 13:08:20 +00:00
nobu 74495cfa11 parse.y: reject invalid codepoint
* parse.y (parser_tokadd_codepoint): reject invalid codepoint,
  surrogate blocks and surrogate pair, as well as mruby.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 08:26:39 +00:00
hsbt df53b1421b Update bundled_gems
* minitest-5.10.0
  * test-unit-3.2.3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 05:24:00 +00:00
shugo d40495f1f6 Wait until excpetion handling is ready.
Because RubyCI on Solaris 10 failed as follows:

    1) Failure:
  TestProcess#test_execopts_redirect_open_fifo_interrupt_raise [/export/home/rubyci/unstable10s/tmp/build/20161130T201909Z/ruby/test/ruby/test_process.rb:646]:
  <"ok\n"> expected but was
  <"">.

The argument of sleep (0.5) can be smaller, but I'm not sure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 04:51:42 +00:00
rhe 95dbfe0dfc openssl: import fixes from upstream
Import the following two commits from upstream:

  commit 72126d6c8b88abd69c3565fc3bbbd5ed1e401611
  Author: Kazuki Yamaguchi <k@rhe.jp>
  Date:   Thu Dec 1 22:27:03 2016 +0900

      pkey: check existence of EVP_PKEY_get0()

      EVP_PKEY_get0() did not exist in early OpenSSL 0.9.8 series. So define
      ourselves if needed.

  commit 94a1c4e0c5705ad1e9a4ca08cacaa6cba8b1e6f5
  Author: Kazuki Yamaguchi <k@rhe.jp>
  Date:   Thu Dec 1 22:13:22 2016 +0900

      test/test_cipher: fix test with OpenSSL 1.0.1 before 1.0.1d

      Set the authentication tag before the AAD when decrypting.

      Before OpenSSL commit 96f7fafa2431 ("Don't require tag before ciphertext
      in AESGCM mode", 2012-10-16, at OpenSSL_1_0_1-stable branch, included in
      OpenSSL 1.0.1d), the authentication tag must be set before any calls of
      EVP_CipherUpdate().

They should fix build on CentOS 5 and Ubuntu 12.04 respectively.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 04:42:10 +00:00
nobu 671c929f0a Use offsetof macro and shrink table size
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 00:34:42 +00:00
nobu 4f7c3d3583 constify CaseMappingSpecials
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-01 00:34:41 +00:00
svn 48beedd5db * 2016-12-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 17:29:20 +00:00
naruse c11e648799 Regexp supports Unicoe 9.0.0's \X
* meta character \X matches Unicode 9.0.0 characters with some workarounds
  for UTR #51 Unicode Emoji, Version 4.0 emoji zwj sequences.
  [Feature #12831] [ruby-core:77586]

The term "character" can have many meanings bytes, codepoints, combined
characters, and so on. "grapheme cluster" is highest one of such words,
which means user-perceived characters.
Unicode Standard Annex #29 UNICODE TEXT SEGMENTATION specifies how to
handle grapheme clusters (extended grapheme cluster).
But some specs aren't updated to current situation because Unicode Emoji
is rapidly extended without well definition.
It breaks the precondition of UTR#29 "Grapheme cluster boundaries can be
easily tested by looking at immediately adjacent characters". (the
sentence will be removed in the next version)
Though some of its detail are described in Unicode Technical Report #51
UNICODE EMOJI but it is not merged into UTR#29 yet.

http://unicode.org/reports/tr29/
http://unicode.org/reports/tr51/
http://unicode.org/Public/emoji/4.0/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 17:29:19 +00:00
nobu e680bfb1ab ossl.c: cast
* ext/openssl/ossl.c (ossl_pem_passwd_cb): cast to int.  it's safe
  because len does not exceed int max_len.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 14:54:09 +00:00
nobu 88b745f0ca parse.y: refine error message
* parse.y (parser_tokadd_utf8): refine error message at bad char
  in unicode escape, "invalid" instead of "unterminated".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 14:43:43 +00:00
rhe aab0d67a1f openssl: import v2.0.0
Import Ruby/OpenSSL 2.0.0. The full commit history since 2.0.0 beta.2
(imported at r56098) can be found at:

  https://github.com/ruby/openssl/compare/v2.0.0.beta.2...v2.0.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 14:41:46 +00:00
hsbt 0a5abaf745 Fixed error with `make install`
rbinstall.rb couldn't load "psych/versions".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 14:24:12 +00:00
hsbt 48e251df47 Update psych-2.2.1
It fixed segmentation fault related with GC.
  https://github.com/ruby/psych/pull/296

  and removed deprecated code of Ruby 1.8.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 13:55:02 +00:00
nobu 5e4b845522 parse.y: parser_tokadd_codepoint
* parse.y (parser_tokadd_codepoint): extract from
  parser_tokadd_utf8.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30 13:09:51 +00:00