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

41455 Коммитов

Автор SHA1 Сообщение Дата
kosaki 99c05fb38e * random.c (Init_RandomSeed): move all Random::DEFAULT
construction bits to Init_RandomSeed2. Random::DEFAULT
  and Ruby internal hashes are no longer shared their seed.
* random.c (Init_RandomSeed2): ditto. And, kill evil
  rb_obj_reveal() stuff.
* random.c (init_hashseed): add MT argument.
* random.c: (init_siphash): ditto.
* test/ruby/test_rand.rb (TestRand#test_default_seed): new
  test for Random::DEFAULT::seed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:31:31 +00:00
kosaki 052535be3e * random.c (init_hashseed, init_siphash): extract initialize
functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:31:11 +00:00
kosaki 0c4e7767ed * configure.in: sort AC_CHECK_HEADERS() by alphabetical order.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:30:50 +00:00
kosaki 12e059b18c * random.c (init_randomseed): remove "initial" argument. It never
be used from outside of this function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:29:37 +00:00
kosaki 7104a473ea * lib/securerandom.rb (SecureRandom::gen_random): use /dev/urandom
for initialize OpenSSL's rand.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:29:22 +00:00
kosaki 07083767e9 * ext/openssl/ossl_rand.c (ossl_rand_bytes): RAND_bytes could
be return -1 as an error. Therefore, added error handling.
* ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:29:02 +00:00
kosaki 86caaefc1f * include/ruby/util.h: remove a warning suppression C4723
(potential divide by zero) for VisualC++. It's meaningless.
  Before r26197, there is ruby_div0() in this place and it
  actually made divide by zero. But now it's just garbage.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:27:52 +00:00
kosaki f7bd7d6f1f * random.c: random_raw_seed don't use GRND_NONBLOCK. GRND_NONBLOCK
mean the result might not have an enough cryptic strength and
  easy predictable. That's no good for SecureRandom.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:27:11 +00:00
svn 9401002fde * 2015-12-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:27:10 +00:00
kosaki dea685c783 * missing/explicit_bzero.c: new file. define explicit_bzero.
* common.mk: add a rule for explicit.o.
* configure.in: detect explicit_bzero and memset_s.
* include/ruby/missing.h: add explicit_bzero.
* random.c (init_randomseed): use explicit_bzero() instead of
  memset(). memset could be eliminated by compiler optimization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 20:26:13 +00:00
kazu 4eeec4869f fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 13:25:34 +00:00
naruse 6db72c0166 * ext/readline/extconf.rb: call dir_config("libedit")
if --enable-libedit is spcified. [Bug #11751]
  patched by John Hein

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 09:48:24 +00:00
nobu 794fb41099 parse.y: dispatch heredoc end
* parse.y (ripper_dispatch_heredoc_end): at the end of here
  document, the terminator always should present.  has_scan_event
  is true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 08:11:17 +00:00
nobu 4c6dd77df5 vm_eval.c: make dsym
* vm_eval.c (rb_throw, rb_catch): get rid of making static IDs,
  use dynamic symbos instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 04:44:41 +00:00
nobu 51964bf995 symbol.c: rb_sym_intern
* symbol.c (rb_sym_intern): rename from rb_cstr_intern and add
  variants.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-30 04:44:39 +00:00
svn 23ce0a421d * 2015-11-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-29 23:54:25 +00:00
normal 9f9861699b variable.c: remove spurious #define for globals
Removing the indirection helps me with readability, at
least.  It doesn't seem like there are many other places
in the Ruby code where macros are used like this.

[ruby-core:71735] [Feature #11749]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-29 23:53:43 +00:00
naruse 42225163c1 SIGTERM should be also captured
because it will terminate the whole test process when it is
re-raised from this assertion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-29 11:45:59 +00:00
nobu fc0c2d1cc2 version.c: remove ruby_engine_name
* ruby.c (load_file_internal, ruby_process_options): share
  ruby_engine instead of literal strings.

* version.c (Init_version): remove internal `ruby_engine_name`,
  but set the VM program name in addition to the global constant.

* vm_backtrace.c (location_to_str, oldbt_init): use th eVM program
  name always.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-29 02:25:12 +00:00
svn d6beaf3215 * 2015-11-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-29 00:13:25 +00:00
nobu b71f6be026 Corrected grammar errors [ci skip]
* NEWS: [DOC] Various grammar corrections and clarifications to
  increase readability.  [Fix GH-1115]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-29 00:13:05 +00:00
nobu 448d1d147d parse.y: last content of heredoc
* parse.y (parser_here_document): store dispatched result of
  on_tstring_content at the last fragment of a here document.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 10:33:58 +00:00
nobu ef44c0ad2f ripper/lexer.rb: dispatch alias
* ext/ripper/lib/ripper/lexer.rb: alias same methods instead of
  eval for each events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 06:56:23 +00:00
nobu cf2b422fc5 ripper/core.rb: share handlers
* ext/ripper/lib/ripper/sexp.rb (SexpBuilderPP): share scanner
  event handlers and most of parser event handlers with
  SexpBuilder.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 05:43:17 +00:00
nobu f8ecb823a0 ripper/core.rb: dispatch alias
* ext/ripper/lib/ripper/core.rb: alias same methods instead of
  eval for each events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-28 05:26:16 +00:00
svn b08bfaf672 * 2015-11-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-27 15:03:45 +00:00
naruse dab944e319 fixup! * lib/net/http.rb (connect): detect closed connection and reconnect If the server closes a keep-alive http connection, the client socket reaches EOF. To avoid an EOFError, detect the closed connection and reconnect. Added test to ensure HTTP#post succeeds even if the keep-alive-connection has been closed by the server. by Kristian Hanekamp <kris.hanekamp@gmail.com> https://github.com/ruby/ruby/pull/1089 fix GH-1089
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-27 15:03:24 +00:00
nobu 36326ceb22 test_parser_events.rb: suppress a warning
* test/ripper/test_parser_events.rb (test_warn_cr_in_middle):
  remove unused variable to suppress assigned-but-unused-variable
  warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-27 14:26:28 +00:00
naruse d249be6233 * lib/net/http.rb (connect): detect closed connection and reconnect
If the server closes a keep-alive http connection, the client socket
  reaches EOF. To avoid an EOFError, detect the closed connection and
  reconnect.
  Added test to ensure HTTP#post succeeds even if the
  keep-alive-connection has been closed by the server.
  by Kristian Hanekamp <kris.hanekamp@gmail.com>
  https://github.com/ruby/ruby/pull/1089 fix GH-1089

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-27 14:07:35 +00:00
nobu 6c0cf1848e parse.y: reduce ifdefs
* parse.y (dispatch_ignored_scan_event, has_delayed_token): more
  macros to reduce ifdefs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-27 02:22:57 +00:00
svn 37e6b8afce * 2015-11-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 15:41:36 +00:00
naruse 8f0268991c Use more tough server: GitHub or repo.or.cz
https://gcc.gnu.org/wiki/GitMirror

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 15:40:58 +00:00
naruse 81ece7f0a1 increase additional nfiles
On recent my environment, it must be more than 11.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 14:13:25 +00:00
nobu 778f32a153 compile.c: tailcall opt for indexers
* compile.c (iseq_peephole_optimize): enable tail call
  optimization for specialized indexers.
* compile.c (iseq_compile_each): blockiseq should be NULL, but not
  Qnil.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 12:36:43 +00:00
nobu a3ddead991 downloader.rb: Downloader.https
* tool/downloader.rb (Downloader.https): extract a method instead
  of a global variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 09:09:49 +00:00
svn 4afebfd2c6 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 08:31:53 +00:00
naruse 9ed1d63f41 * regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
Merge Onigmo 58fa099ed1a34367de67fb3d06dd48d076839692
  + https://github.com/k-takata/Onigmo/pull/52

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 08:31:27 +00:00
naruse 360b98355e fixup! r52695
OpenSSL's SHA1 struct name is SHA_CTX (which is also used for SHA-0),
but function name is SHA1_Transform.
http://openssl.org/docs/man0.9.8/crypto/SHA1.html

also note that LibreSSL 2.3 remove the SHA-0 support but still support SHA-1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 08:31:12 +00:00
hsbt 676c80d203 * test/coverage/test_coverage.rb: Added test-case for Coverage.restart.
[Misc #11732][ruby-dev:49379]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 00:51:03 +00:00
hsbt a4ac506551 * test/coverage/test_coverage.rb: Added test-case for Coverage.peek_result
without Coverage.start. [Misc #11726][ruby-core:71622]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-26 00:48:56 +00:00
svn 717e60c79c * 2015-11-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 22:24:05 +00:00
normal 14920f93c9 test/openssl/test_ssl.rb (test_copy_stream): new test
I was worried r52750 would break IO.copy_stream with things like
OpenSSL sockets which wrap IOs, but require data to be run through
through encryption/decryption filters.  Apparently my worry
was unfounded, but perhaps this test will ensure this case continues
to work.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 22:23:34 +00:00
nobu 7d92e5cf73 io.c: try to_io first
* io.c (copy_stream_body): try to_io conversion before read,
  readpartial, and write methods.  [ruby-dev:49008] [Bug #11199]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 12:23:42 +00:00
nobu 012368007f iseq.h: rename member
* iseq.h (rb_compile_option_struct): rename the member
  frozen_string_literal_debug as debug_frozen_string_literal.
  [Feature #11725]

* ruby.c (proc_options): do not set $DEBUG and $VERBOSE only if no
  arguments is given.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 08:02:29 +00:00
ko1 9b7d4d4709 add NEWS entry about --debug=frozen-string-literal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 07:39:14 +00:00
nobu 311a9eb0c5 configure.in: color to ifchange
* configure.in: pass --color to ifchange from CONFIGURE_TTY for
  reconfig.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 03:36:13 +00:00
nobu 0bd9072758 test_objectspace.rb: missing tests from rubyspec
* test/ruby/test_objectspace.rb (test_each_object): incorporated
  from rubyspec.

* test/ruby/test_objectspace.rb (test_each_object_enumerator):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 03:18:13 +00:00
shugo 94da8b1737 * io.c (argf_getpartial): should not resize str if the second
argument is not given.
  [ruby-core:71668] [Bug #11738]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-25 01:57:48 +00:00
svn ff838167ba * 2015-11-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-24 15:03:40 +00:00
ngoto 06c04b3874 * configure.in: On Solaris, it is safe to define _LARGEFILE_SOURCE
when _FILE_OFFSET_BITS=64 is defined (= when 32-bit compile).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-24 15:00:57 +00:00