aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* fix non-static rb_scan_argsnobu2016-05-272-35/+138
| | | | | | | | | | | | * include/ruby/ruby.h (rb_scan_args): remove nul padding which caused syntax error if fmt is not a string literal. * include/ruby/ruby.h (rb_scan_args_verify): suppress array-bounds warnings by old clang. * include/ruby/ruby.h (rb_scan_args0): make extractor macros inline functions, which do not varidate the format and are unnecessary to be expanded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: fix parameter namenobu2016-05-271-1/+1
| | | | | | * include/ruby/ruby.h (rb_scan_args): fix macro parameter name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * symbol.c (is_identchar): use ISDIGIT instead of rb_enc_isalnum.naruse2016-05-262-5/+15
| | | | | | | | | | | Though rb_enc_isalnum is encoding aware function, its argument here is *m, which is a single byte. Therefore ISDIGIT is faster. * symbol.c (is_special_global_name): ditto. * symbol.c (rb_enc_symname_type): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-27svn2016-05-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: fix for old clangnobu2016-05-262-9/+23
| | | | | | | | | | | | | | | | * include/ruby/ruby.h (rb_scan_args): add nul padding here to apply to all references. * include/ruby/ruby.h (rb_scan_args_verify): move length mismatch check outside conditional operators. Since old clang cannot optimize away string literal dereference by an immediate index, e.g., ""[0], and both of true and false side expressions are compiled and warned unintentionally. With such old compilers, the check in rb_scan_args() does not work but may result unpredictable value if the format is wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: avoid NULL dereference in {DH,DSA,RSA}_size()rhe2016-05-264-9/+32
| | | | | | | | | | | | | | | | * ext/openssl/ossl_pkey_dh.c (ossl_dh_compute_key): Check that the DH has 'p' (the prime) before calling DH_size(). We can create a DH with no parameter but DH_size() does not check and dereferences NULL. [ruby-core:75720] [Bug #12428] * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_sign): Ditto. DSA_size() does not check dsa->q. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt, ossl_rsa_public_decrypt, ossl_rsa_private_encrypt, ossl_rsa_private_decrypt): Ditto. RSA_size() does not check rsa->n. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: suppress warningsnobu2016-05-261-2/+2
| | | | | | | * include/ruby/ruby.h (rb_scan_args_count): add filler nul bytes to suppress array-bounds warnings by old clang. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: count and verifynobu2016-05-262-71/+57
| | | | | | | * include/ruby/ruby.h (rb_scan_args_count): verify length with counting variables together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r55171nobu2016-05-262-36/+31
| | | | | | | | Revert r55171, "ruby.h: fix clang warnings", it did fix array-bounds warnings, but caused string-plus-int warnings instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: fix clang warningsnobu2016-05-262-31/+36
| | | | | | | * include/ruby/ruby.h (rb_scan_args0): use pointer dereference forms instead of array forms, to get rid of warnings by clang. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2016-05-260-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-05-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/enc/test_case_comprehensive.rb: Add set of comprehensiveduerst2016-05-262-0/+123
| | | | | | | | (across most Unicode characters; later across most character encodings) tests for case mapping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-26svn2016-05-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_class): Fix documentation.eregon2016-05-252-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (unescape_nonascii): scan hex up to only 3 characters.naruse2016-05-252-2/+7
| | | | | | [Bug #12420] [Bug #12423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/unicode.c: Handle DOTLESS_i by hand because it isn't involved in folding.duerst2016-05-252-1/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regparse.c (fetch_token_in_cc): raise error if given octal escapednaruse2016-05-253-1/+8
| | | | | | character is too big. [Bug #12420] [Bug #12423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: drop OpenSSL 0.9.6/0.9.7 supportrhe2016-05-2532-874/+173
| | | | | | * ext/openssl, test/openssl: Drop OpenSSL < 0.9.8 support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: remove unnecessary 'extern "C"' blocks from local headersrhe2016-05-253-17/+6
| | | | | | | | * ext/openssl/openssl_missing.h, ext/openssl/ossl.h: Remove unnecessary 'extern "C"' blocks. We don't use C++ and these headers are local to ext/openssl, so there is no need to enclose with it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: remove check of OPENSSL_FIPS macro in extconf.rbrhe2016-05-253-3/+11
| | | | | | | | | | | * ext/openssl/extconf.rb: Remove check of OPENSSL_FIPS macro. This is unneeded because we can check the macro directly in source code, just as we already do for OPENSSL_NO_* macros. * ext/openssl/ossl.c: Replace occurrences of HAVE_OPENSSL_FIPS with OPENSSL_FIPS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c: simplifynobu2016-05-252-10/+8
| | | | | | * class.c (rb_scan_args): merge code for n_trail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: rb_scan_args_validatenobu2016-05-252-6/+34
| | | | | | | * include/ruby/ruby.h (rb_scan_args_validate): move failed condition to the terminal. [ruby-core:75714] [Bug #12426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regcomp.c: fix debug conditionalsnobu2016-05-251-7/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fake.rb: buildlibdirnobu2016-05-251-1/+2
| | | | | | | * tool/fake.rb: set "buildlibdir" to the build directory, instead of "builddir" which is filterd by MakeMakefile#configuration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regcomp.c: remove condition for debug output because preludenaruse2016-05-252-16/+13
| | | | | | doesn't use regexp now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regcomp.c (compile_length_tree): return error code immediatelynaruse2016-05-253-5/+15
| | | | | | if compile_length_tree raised error [Bug #12418] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/unicode.c: Fix flag error for switch from titlecase to lowercase.duerst2016-05-243-4/+34
| | | | | | | * test/ruby/enc/test_case_mapping.rb: Tests for above error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: add EC.generaterhe2016-05-243-51/+117
| | | | | | | | | | | | | | * ext/openssl/ossl_pkey_ec.c (ec_key_new_from_group): Create a new EC_KEY on given EC group. Extracted from ossl_ec_key_initialize(). (ossl_ec_key_s_generate): Added. Create a new EC instance and generate a random private and public key. (ossl_ec_key_initialize): Use ec_key_new_from_group(). (Init_ossl_ec): Define the new method EC.generate. This change is for consistency with other PKey types. [ruby-core:45541] [Bug #6567] * test/openssl/test_pkey_ec.rb: Test that EC.generate works. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: rename EC#generate_key to EC#generate_key!rhe2016-05-243-5/+24
| | | | | | | | | | | | * 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
* ruby.h: optimize rb_scan_args_setnobu2016-05-242-15/+12
| | | | | | | | * 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-25svn2016-05-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: merge ruby_cflags to XCFLAGSnobu2016-05-242-3/+7
| | | | | | | * 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
* Remove a space [ci skip]kazu2016-05-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: make Cipher#key= and #iv= reject too long valuesrhe2016-05-243-5/+31
| | | | | | | | | | | | * 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
* openssl: avoid deprecated M_ASN1_* macrosrhe2016-05-243-10/+17
| | | | | | | | | | | | | | | | * 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
* ruby.h: rb_scan_args_verifynobu2016-05-242-48/+95
| | | | | | | | * 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
* defines.h: fallback ERRORFUNC and WARNINGFUNCnobu2016-05-242-0/+17
| | | | | | | * 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
* * configure.in (ruby_cflags): separate from optflags [Bug #12409]naruse2016-05-242-2/+13
| | | | | | | | -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
* fix missing argumentnobu2016-05-241-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix __error__ and __warning__ attribute checksnobu2016-05-242-3/+8
| | | | | | | * 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-24svn2016-05-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk : sort lines, and add missing dependencies suggestedshyouhei2016-05-242-8/+17
| | | | | | | by tool/update-deps git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix indent (tabify) [ci skip]kazu2016-05-231-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* missing.h: isfinitenobu2016-05-234-12/+11
| | | | | | * 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
* openssl: Avoid reference to unset global variable in Init_openssl()rhe2016-05-232-8/+17
| | | | | | | | | | | * 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
* openssl: use StringValueCStr() where NUL-terminated string is expectedrhe2016-05-2317-82/+90
| | | | | | | | | | | | | | * 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
* * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning onusa2016-05-232-1/+6
| | | | | | | cygwin. [Bug #12417][ruby-core:75691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: fix incorrect return value check of RAND_* functionsrhe2016-05-232-7/+14
| | | | | | | | | | | * 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
* revert error attributesnobu2016-05-231-5/+0
| | | | | | | * 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