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

26908 Коммитов

Автор SHA1 Сообщение Дата
ko1 5421cea252 * method.h (METHOD_ENTRY_BASIC_SET): should clear last bit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 06:54:49 +00:00
hsbt 038213351b * lib/rubygems.rb: bump version to 2.4.7 and 2.4.8. these versions fixed
CVE-2015-3900.
* lib/rubygems/remote_fetcher.rb: ditto.
* test/rubygems/test_gem_remote_fetcher.rb: added testcase for CVE-2015-3900

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 05:34:52 +00:00
hsbt 7d3923e9d8 * lib/rubygems.rb: bump version to 2.4.6. It's missing change at r49774.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 05:18:58 +00:00
nobu 37e3fec4bb array.c: fix array size overflow
* array.c (ary_ensure_room_for_push): check if array size will
  exceed maxmum size to get rid of buffer overflow.
  [ruby-dev:49043] [Bug #11235]
* array.c (ary_ensure_room_for_unshift, rb_ary_splice): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 04:50:22 +00:00
usa b12540e1eb * test/test_cmath.rb (TestCMath#test_trigonometric_functions): should
not compare float values (in complex values) by `==`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 04:19:15 +00:00
svn a3b89d7493 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 23:55:36 +00:00
ko1 a5fa5f34b0 * method.h: embed rb_method_entry_t::attr::flags (5 bits) into
rb_method_entry_t::flags to make one word spare space.
  Add some macros to access these flags.
* vm_method.c: use these macros.
* internal.h: define IMEMO_FL_USHIFT and IMEMO_FL_USER[0-4]
  for T_IMEMO local flags.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 23:55:33 +00:00
ko1 c7edd997e8 * vm.c: use VM_ASSERT instead of assert().
* vm_args.c: ditto.
* vm_insnhelper.c: ditto.
* vm_method.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 23:42:01 +00:00
ko1 85647d9f2b * vm_core.h: define VM_ASSERT() for assertion
enabled only when (VM_CHECK_MODE > 0).
* vm_insnhelper.c: move definition VM_CHECK_MODE
  from vm_insnhelper.c to vm_core.h.
* vm.c: remove <assert.h>



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 23:25:30 +00:00
ko1 62a81ad98c * vm_insnhelper.c (check_frame): check type of cref_or_me first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 21:56:23 +00:00
gogotanaka 4ddbc83c91 * test/test_cmath.rb: Add assertions for trigonometric functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 20:04:37 +00:00
gogotanaka fcf7d234fb * test/test_cmath.rb: Add assertions for error handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 19:39:59 +00:00
nobu 9ddccb154e fake.rb.in: match spaces
* template/fake.rb.in: expanded macro result may have spaces
  between tokens.  [ruby-dev:49047] [Bug #11243]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 15:34:42 +00:00
ngoto edb8c7a9f3 * lib/mkmf.rb: revert r50804 because of build failure when specifying
LDFLAGS during configure, observed on Solaris with GCC 4.6.
  [Bug #11245]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 13:37:03 +00:00
kazu 258c1ba5fb README.ja.md: fix markup miss. [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 13:03:07 +00:00
nobu c5634371dc fake.rb.in: accurate fake
* template/fake.rb.in: turn into erb template from autoconf
  template to fake more accurately.
* common.mk (fake.rb): needs preprocessed file now.
* version.c (Init_version): add dummy expression to
  RUBY_ENGINE_VERSION.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 02:06:28 +00:00
marcandre 7ea2bb3235 * lib/prime.rb: Simplify and optimize EratosthenesSieve
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-09 03:32:45 +00:00
marcandre 3ed18fa817 * lib/matrix.rb: Simplify and optimize EratosthenesSieve
based on patch by Ajay Kumar. [Fixes GH-921]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-09 02:45:31 +00:00
ko1 0d3591f250 * gc.c (obj_info): print method id for T_IMEMO/ment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-07 20:11:36 +00:00
kazu 3fe13558fd fix typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-07 15:06:24 +00:00
gogotanaka 3eb63250ab * Move test cases from test/ruby/test_complex.rb to test/test_cmath.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 22:11:00 +00:00
ko1 c19d373750 * method.h: back to share rb_method_definition_t by
rb_method_entry_t.
  r50728 changed sharing `def's to isolating `def's
  on alias and so on. However, this change conflicts
  future improvement plan. So I change back to sharing approach.
* method.h: move rb_method_definition_t::flags to
  rb_method_entry_t::attr::flags.
  rb_method_entry_t::attr is union with VALUE because this field
  should have same size of VALUE. rb_method_entry_t is T_IMEMO).
  And also add the following access macros to it's fileds.
  * METHOD_ENTRY_VISI(me)
  * METHOD_ENTRY_BASIC(me)
  * METHOD_ENTRY_SAFE(me)
* vm_method.c (rb_method_definition_addref): added instead of
  rb_method_definition_clone().
  Do not create new definition, but increment alias_count.
* class.c (clone_method): catch up this fix.
* class.c (method_entry_i): ditto.
* proc.c (mnew_internal): ditto.
* proc.c (mnew_missing): ditto.
* vm_eval.c: ditto.
* vm_insnhelper.c: ditto.
* vm_method.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 10:19:48 +00:00
ko1 c9044a2472 * class.c: ins_methods_push() needs rb_method_visibility_t type on
2nd arg.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 07:01:21 +00:00
ko1 1f9af2a953 * class.c (ins_methods_push): Change type and name of parameters
to make more clear.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 06:07:06 +00:00
normal 5d983e4fb2 test/socket/test_nonblock.rb: try to avoid EMSGSIZE
We want to test the IO::WaitWritable behavior, so silently
discarding Errno::EMSGSIZE prevents the test from being
effective.
[ruby-core:69466]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 23:55:23 +00:00
ko1 ea67fb97d9 * gc.c: remove struct mark_tbl_arg and pass objspace directly
to avoid indirect access overhead.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 23:00:22 +00:00
normal 5a67d8e2e9 * ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment
We call memset to zero `mh' a few lines above anyways, making
explicitly zero-ing each field unnecessary.

Compilers optimize this code away anyways, but it still costs me
4 lines of my small terminal and even smaller attention span.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 22:21:47 +00:00
ngoto 607abcc7be * ext/socket/ancdata.c (bsock_sendmsg_internal): all arguments are
parsed even on systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL
  to prevent SEGV caused by passing Qnil to RARRAY_LENINT and
  to preserve behavior before r50776.
  [Bug #11224] [ruby-core:69468] [Bug #11225] [ruby-core:69469]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 16:11:47 +00:00
ko1 eb774ceb22 * class.c (ins_methods_push): change 3rd parameter's type
from long to rb_method_visibility_t.
* class.c (ins_methods_i): catch up this fix.
* class.c (method_entry_i): cast to st_data_t instead of `long'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 13:39:59 +00:00
ko1 b6b76e3a85 * internal.h: move definition of rb_cref_t to method.h.
* eval_intern.h: move definition of rb_scope_visibility_t
  to method.h.
* method.h: change rb_cref_t::scope_visi from VALUE to
  rb_scope_visibility_t.
  [Bug #11219]
* vm.c (vm_cref_new): accept rb_method_visibility_t directly.
* vm_insnhelper.c (rb_vm_rewrite_cref): don't use 0,
  but METHOD_VISI_UNDEF.
* vm_method.c (rb_scope_visibility_set): don't need to use cast.
* vm_method.c (rb_scope_module_func_set): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 11:42:34 +00:00
normal 7ac8fe7407 ext/socket/ancdata.c (bsock_sendmsg_internal): portability fix
* ext/socket/ancdata.c (bsock_sendmsg_internal): avoid msg_control
  ptr if msg_controllen is zero to fix portability problems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 08:28:14 +00:00
normal 20dedbfd9d ext/socket/ancdata.c (bsock_sendmsg_internal): fix build error from r50776
Systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL still need
controls to be nil for the check after argument parsing.

Note: not actually tested on a real system without msg_control

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 00:18:30 +00:00
normal cee9f4a499 io.c: reduce size of :wait_*able code paths
* io.c (sym_wait_readable, sym_wait_writable): declare
  (io_getpartial): use sym_wait_readable
  (io_write_nonblock): use sym_wait_writable
  (Init_IO): initialize sym_wait_*able

On 32-bit x86:

   text    data     bss     dec     hex filename
 121003      56     252  121311   1d9df io.o
 121035      56     252  121343   1d9ff io.o.orig

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 22:11:19 +00:00
normal 5c461d1eee doc/extension.rdoc: note rb_get_kwargs changes keywords_hash [ci skip]
[ruby-core:68507]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 21:45:23 +00:00
normal 4dd6c370b9 ChangeLog: add entry for r50776 [ci skip]
* ext/socket/ancdata.c (bsock_sendmsg_internal): use rb_scan_args
  [ruby-core:69439] [Feature #11207]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 20:53:17 +00:00
ko1 99ee18afcb * test/lib/envutil.rb (assert_no_memory_leak): change default value
of limit from 1.5 to 2.0. It is ad-hoc fix to solve test failure
  in travis-ci.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 17:21:24 +00:00
ko1 63e1601049 * vm_insnhelper.c (vm_defined): no need to use cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 16:17:53 +00:00
ko1 54a9ac7655 * vm_insnhelper.c (vm_defined): show additional messages on rb_bug().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 16:15:13 +00:00
ko1 0f419d39b4 * vm_method.c (rb_add_method_iseq): use intermediate struct to
avoid initializing struct with variables.
  [Bug #11217]
* method.h: add a comment about it.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 16:08:40 +00:00
ko1 3619a8b52d * method.h: constify rb_method_refined_t::orig_me.
Also constify the following functions.
  * rb_resolve_refined_method()
  * rb_method_entry_with_refinements()
  * rb_method_entry_without_refinements()
  * rb_method_entry_copy()'s parameter.
* class.c: catch up this fix.
* vm_insnhelper.c: ditto.
* vm_method.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 16:02:01 +00:00
kazu 9d0fc5a819 fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 13:54:33 +00:00
kazu 6db5b1eaa5 fix unbalanced parenthesis
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 13:54:25 +00:00
hsbt 5015e057fb * array.c: Revert r50763. because "reentered" is not typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 04:49:26 +00:00
hsbt 0eb195cee3 * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton
[fix GH-923]
* include/ruby/st.h: ditto.
* include/ruby/util.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 02:53:11 +00:00
hsbt 05f3eaa739 * ChangeLog: fixed name at latest commit
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 02:04:11 +00:00
hsbt df55f4170a * array.c: fix a typo. Patch by @manish-shrivastava
[fix GH-922]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 01:54:41 +00:00
normal 14cbd61f01 ext/openssl/lib/openssl/ssl.rb: use io/nonblock instead of fcntl
[ruby-core:69382] [Feature #11190]

IO#nonblock= is easier-to-read, potentially more portable, and
avoids redundantly setting flags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 01:09:09 +00:00
ko1 9e73d45e0f * method.h: introduce rb_method_refined_t for refined method entry.
* class.c (move_refined_method): catch up this fix.
* gc.c (mark_method_entry): ditto.
* vm_eval.c (vm_call0_body): ditto.
* vm_insnhelper.c (vm_call_method): ditto.
* vm_method.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03 22:27:51 +00:00
nobu 9375ff5b06 dir.c: FNM_SHORTNAME
* dir.c (dirent_match): match short names only when FNM_SHORTNAME
  flag is given, for the backward compatibility, and the new
  behavior is often dangerous.  [ruby-core:69435] [Bug #11206]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03 22:12:24 +00:00
normal 99487313fd ChangeLog: add missing reference
[ruby-core:69441] [Feature #11208]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-03 20:57:23 +00:00