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

39630 Коммитов

Автор 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
nobu f0fd305528 vm_core.h: make VM_ASSERT an expression
* vm_core.h (VM_ASSERT): make an expression, as well as standard
  assert().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 02:35:46 +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
svn d766f4698b * 2015-06-11
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 15:34:54 +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
gogotanaka 1781c4c1e1 * Fix typo. Patch by @davydovanton
[Fix GH-928][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 05:06:25 +00:00
nobu 4868eead07 common.mk: update version.i
* common.mk (version.i): ensure up-to-date.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 02:13:04 +00:00
svn d5c03541f5 * 2015-06-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-10 02:06:40 +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
nobu d3bce79183 version.c: use str_new_static
* version.c (MKSTR): always make from static strings for sizeof
  operator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-09 07:25:44 +00:00
nobu c5e8342d4f mkmf.rb: macro assigments
* lib/mkmf.rb ($configure_args): store macro assigments as-is, not
  only in option style.  e.g., ruby extconf.rb optflags=-O0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-09 06:58:18 +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 9d3c64a40a * lib/prime.rb: Simplify and optimize EratosthenesSieve
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-09 03:32:11 +00:00
svn d46336e717 * 2015-06-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-09 02:45:44 +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
svn b2dd608a6b * 2015-06-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-07 15:06:48 +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
gogotanaka e0934947d3 * lib/cmath.rb: [DOC] Documentation improvements [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 20:35:35 +00:00
svn a8b34c375d * 2015-06-07
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 20:35:23 +00:00
gogotanaka 843019f4a0 * lib/cmath.rb: [DOC] Add docs [ci skip][Fix GH-909][Bug #11162]
Patch provided by @davydovanton

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 20:35:08 +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
nobu 32a586d738 class.c: suppress a warning
* class.c (ins_methods_push): suppress a signed and unsigned
  comparison warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-06 01:37:50 +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
svn 6f586ac405 * 2015-06-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-05 16:11:59 +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