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

43471 Коммитов

Автор SHA1 Сообщение Дата
rhe 8cbd74a362 openssl: rename EC#generate_key to EC#generate_key!
* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_generate_key): Fix up RDoc.
  (Init_ossl_ec): Rename EC#generate_key to EC#generate_key!. Make the
  old name an alias of #generate_key!. This change is for consistency
  with other PKey types.  [ruby-core:45541] [Bug #6567]

* test/openssl/test_pkey_ec.rb: Use EC#generate_key! instead of
  EC#generate_key.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 16:27:11 +00:00
nobu b3d3d52cd6 ruby.h: optimize rb_scan_args_set
* include/ruby/ruby.h (rb_scan_args_set): check the arity after
  adjusting argc for an option hash, for optimization in simpler
  cases.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 15:23:06 +00:00
svn 4e612fa608 * 2016-05-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 15:21:54 +00:00
nobu b1d28feffb configure.in: merge ruby_cflags to XCFLAGS
* configure.in (XCFLAGS): merge flags only for ruby itself from
  ruby_cflags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 15:21:53 +00:00
kazu b2bc7f3c86 Remove a space [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 14:00:53 +00:00
rhe ce635262f5 openssl: make Cipher#key= and #iv= reject too long values
* ext/openssl/ossl_cipher.c (ossl_cipher_set_key, ossl_cipher_set_iv):
  Reject too long values as well as too short ones. Currently they
  just truncate the input but this would hide bugs and lead to
  unexpected encryption/decryption results.

* test/openssl/test_cipher.rb: Test that Cipher#key= and #iv= reject
  Strings with invalid length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 13:09:03 +00:00
rhe cff5bd6306 openssl: avoid deprecated M_ASN1_* macros
* ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): Use
  ASN1_OCTET_STRING_set() instead of M_ASN1_OCTET_STRING_set(). Macros
  prefixed by "M_" are discouraged to be used from outside OpenSSL
  library[1].
  (ossl_x509ext_get_value): Likewise, use ASN1_STRING_print() instead
  of M_ASN1_OCTET_STRING_print().
  [1] https://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=CHANGES;h=bf61913d7b01212b4d8b2f3c13d71d645914f67c;hb=b6079a7835f61daa9fb2cbf9addfa86049523933#l878

* ext/openssl/ossl.h: Include openssl/asn1.h instead of
  openssl/asn1_mac.h. It just includes openssl/asn1.h and defines some
  additional "M_" macros.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 12:39:57 +00:00
nobu eb15df1f89 ruby.h: rb_scan_args_verify
* include/ruby/ruby.h (rb_scan_args_verify): verify the format to
  scan if no invalid chars and variable argument length matching,
  at the compile time if possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 09:52:14 +00:00
nobu 6a787c68bc defines.h: fallback ERRORFUNC and WARNINGFUNC
* include/ruby/defines.h (ERRORFUNC, WARNINGFUNC): add fallback
  definitions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 08:18:47 +00:00
naruse 80db1d6145 * configure.in (ruby_cflags): separate from optflags [Bug #12409]
-fexcess-precision=standard and -fp-model precise are set to this now.

* configure.in (cflags): use ruby_cflags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 07:49:25 +00:00
nobu e0a31f4f23 fix missing argument
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 07:28:34 +00:00
nobu 970b092e4c fix __error__ and __warning__ attribute checks
* configure.in (ERRORFUNC, WARNINGFUNC): __error__ and __warning__
  attributes take a parenthesized string literal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 07:20:55 +00:00
svn 4eb0e18084 * 2016-05-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 03:44:00 +00:00
shyouhei 42db62c195 * common.mk : sort lines, and add missing dependencies suggested
by tool/update-deps


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24 03:43:59 +00:00
kazu 7f087e2c7d fix indent (tabify) [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 13:26:22 +00:00
nobu 88cc25f96d missing.h: isfinite
* include/ruby/missing.h (isfinite): move from numeric.c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 12:33:39 +00:00
rhe d45c09fb12 openssl: Avoid reference to unset global variable in Init_openssl()
* ext/openssl/ossl.c (Init_openssl): Avoid reference to unset global
  variable. ossl_raise() may be called before dOSSL is set. Since
  global variables default to 0 and the default value of dOSSL set in
  Init_openssl() is also Qfalse, there is no real issue but confusing.
  Patch by Bertram Scharpf <software@bertram-scharpf.de>
  [ruby-core:58264] [Bug #9101]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 12:10:38 +00:00
rhe 582fa9cde9 openssl: use StringValueCStr() where NUL-terminated string is expected
* ext/openssl/ossl_asn1.c, ext/openssl/ossl_bn.c,
  ext/openssl/ossl_cipher.c, ext/openssl/ossl_digest.c
  ext/openssl/ossl_engine.c, ext/openssl/ossl_ns_spki.c
  ext/openssl/ossl_pkcs12.c, ext/openssl/ossl_pkcs7.c
  ext/openssl/ossl_pkey.c, ext/openssl/ossl_pkey_ec.c
  ext/openssl/ossl_rand.c, ext/openssl/ossl_ssl.c
  ext/openssl/ossl_x509attr.c, ext/openssl/ossl_x509cert.c
  ext/openssl/ossl_x509ext.c, ext/openssl/ossl_x509store.c: Use
  StringValueCStr() where NUL-terminated string is expected.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 11:40:07 +00:00
usa b9da060bd8 * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on
cygwin. [Bug #12417][ruby-core:75691]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 11:21:11 +00:00
rhe 9f0cf20fbd openssl: fix incorrect return value check of RAND_* functions
* ext/openssl/ossl_rand.c (ossl_rand_egd, ossl_rand_egd_bytes):
  RAND_egd{_bytes,}() return -1 on failure, not 0.
  Patch by cremno phobia <cremno@mail.ru>
  [ruby-core:63795] [Bug #10053]
  (ossl_pseudo_bytes): Similar, RAND_pseudo_bytes() may return 0 or
  -1 on failure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 10:47:37 +00:00
nobu 2d9d6caabd revert error attributes
* include/ruby/ruby.h (rb_scan_args0): revert error attributes,
  which may not be optimized away in readline extension library.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 10:45:13 +00:00
nobu 3355640a25 fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 10:35:37 +00:00
usa 921ff3029b * ext/bigdecimal/bigdecimal.c (isfinite): isfinite does not always
exist.  fixed build error on Windows itroduced at r55123.

I found that more complex definition of isfinite in numeric.c.
But it's unused because it inplicitly checks not defined _WIN32.
I don't know why the code do that.
IMO, the definition of isfinite should be put at missing.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 06:55:48 +00:00
nobu 3d18ceab9a tcltklib.c: elimitate dead code
* ext/tk/tcltklib.c (lib_do_one_event_core): elimitate dead code.
  after Check_Type, FIX2INT which implies conversion is not
  useless.  nil and fixnum cannot be tainted.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 04:40:43 +00:00
nobu c285a4e357 remove unnecessary volatiles
* ext/dbm/dbm.c (fdbm_initialize): used for rb_sys_fail_str.

* ext/sdbm/init.c (fsdbm_initialize): ditto.

* ext/tk/tcltklib.c (lib_do_one_event_core): no effect.

* ext/tk/tkutil/tkutil.c (tk_eval_cmd, tk_get_eval_string): no
  effect if tail call optimized.

* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): set to const.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 04:31:55 +00:00
nobu 19f143221c tkutil.c: GC guards
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): add GC guards
  instead of volatile after the uses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 04:31:54 +00:00
nobu a6144809eb make compile error if possible
* include/ruby/ruby.h (rb_scan_args0): make compile error if the
  format is wrong or does not match with the variable argument
  length if possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 04:19:43 +00:00
nobu 14c43e2be6 fatal error if variable argument length mismatch
* include/ruby/ruby.h (rb_scan_args0): raise fatal error if
  variable argument length does not match, it is a bug in the code
  which uses rb_scan_args, not a runtime error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 03:47:11 +00:00
nobu 4a574f7ad9 bigdecimal.c: fix FloatDomainError
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider
  non-finite float values not to raise FloatDomainError.
  [ruby-core:75682] [Bug #12414]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 03:30:30 +00:00
naruse cb2a99822e * array.c (rb_ary_fill): suppress warnings: 'item' may be used
uninitialized in this function

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23 03:23:24 +00:00
svn f00ec4fb38 * 2016-05-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 23:09:39 +00:00
normal bee0756ea9 dir.c (dir_close): update RDoc for 2.3 #close change
[ruby-core:75679] [Bug #12413]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 23:09:38 +00:00
svn 771064fa1d * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 11:03:44 +00:00
seki 021e8ead5c use finalizer trick instead of thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 11:03:43 +00:00
duerst 0bf2e5c70b * test/ruby/enc/test_case_options.rb: adjust test class name
to match file name


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 08:25:18 +00:00
duerst de305716c2 * rename test/ruby/enc/test_casing_options.rb to test_case_options.rb
for consistency


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 08:24:08 +00:00
nobu 6ce18e3a8b transcode.c: GC guards
* transcode.c (enc_arg, str_transcode_enc_args, econv_args):
  remove volatile, and add GC guards in callers.
  [ruby-core:75664] [Bug #12411]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 08:06:57 +00:00
nobu 006634b489 -test-/integer
* ext/-test-/integer/core_ext.c: move testutil/integer.c.
* test/lib/-test-/integer.rb: extract implementation details from
  test/unit/assertions.rb.  [Bug #12408]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 07:27:02 +00:00
duerst 78c5ca7074 * include/ruby/oniguruma.h: Extend OnigEncodingTypeDefine to define a
new encoding primitive 'case_map' for case mapping
* enc/utf-8.c, utf_16be/le.c, utf_32be/le.c:
  add onigenc_unicode_case_map as case_map primitive
* enc/ascii.c, big5.c, cp949.c, emacs_mule.c, euc_jp/kr/tw.c, gb18030.c,
  gbk.c, iso_8859_1/2/3/4/5/6/7/8/9/10/11/13/14/15/16.c, koi8_r/u.c,
  shift_jis.c, us_ascii.c, windows_1250/1251/1252.c:
  add onigenc_not_support_case_map as case_map primitive


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 05:57:44 +00:00
duerst 14b524b6b0 regenc.h/c: Define new function onigenc_not_support_case_map
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 05:45:45 +00:00
naruse cadbde584a * include/ruby/ruby.h (rb_scan_args): use original rb_scan_args
when fmt is dynamic.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 03:31:22 +00:00
naruse 75307ce858 * class.c (rb_scan_args): moved to bottom of the file to make the
effect of `#undef rb_scan_args` the minimum.

* include/ruby/ruby.h (rb_scan_args): overwrite only if GCC and
  optimized. Visual C++ 14 or later can compile it but make it
  conservative.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 02:44:54 +00:00
nobu b9fe5948f3 move duplicate assertions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 02:28:03 +00:00
nobu 45e3b48be5 just check Integer
* test/ruby/test_bignum.rb (test_pow): just assert to be an
  Integer.

* test/ruby/test_integer_comb.rb (check_class): ditto.

* test/ruby/test_numeric.rb (test_coerce): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 18:09:05 +00:00
nobu a7955b31c0 hash method values
* test/ruby/test_{complex,range,rational,struct}.rb (test_hash):
  hash values should be an Integer, not only a Fixnum.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 18:06:04 +00:00
svn f73e6f5a53 * 2016-05-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 17:47:53 +00:00
naruse fd307c3b60 * ext/zlib/zlib.c: remove hacky macro introduced at r30437.
* ext/zlib/zlib.c (gzfile_make_header): cast as long (instead of int).

* ext/zlib/zlib.c (gzfile_make_footer): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 17:47:52 +00:00
naruse 8becb1e465 Revert r50102
This reverts "* include/ruby/ruby.h (rb_scan_args): don't use ALWAYS_INLINE with"
This rb_scan_args macro is GCCism.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 14:01:23 +00:00
usa 3caa177668 * include/ruby/ruby.h (rb_scan_args): don't use ALWAYS_INLINE with
`inline`.  if gcc needs this duplication, do in ALWAYS_INLINE macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 13:47:06 +00:00
naruse cc41066002 * include/ruby/ruby.h (rb_scan_args): use __VA_ARGS__ instead of
va_arg to allow compilers optimize more aggressive.
  https://gustedt.wordpress.com/2011/07/10/avoid-writing-va_arg-functions/
  rb_scan_args is now expected to be statically resolved.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 13:24:33 +00:00