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

63 Коммитов

Автор SHA1 Сообщение Дата
shirosaki 262cb379d6 st_update passes the key in st_table
* st.c (st_update): pass the key in st_table so that we can free
  memory of the key in st_table when deleting.
  [ruby-core:49220] [Bug #7330]

* test/-ext-/st/test_update.rb
  (Bug::StTable#test_pass_objects_in_st_table): add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-17 02:46:13 +00:00
nobu f230b1ec98 test_printf.rb: need to be infected
* test/-ext-/test_printf.rb (Test_SPrintf#test_{taint,untrust}): use
  plain object so that the results of to_s and inspect are infected.
  [ruby-dev:46053] [Bug #6881]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-16 02:52:09 +00:00
nobu 665b06ec5b sprintf.c: infect
* sprintf.c (ruby__sfvextra): the result should be infected by the
  given strings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15 07:26:55 +00:00
nobu bb545e2131 sprintf.c: coderange fix
* sprintf.c (ruby__sfvwrite): set buffer length and exclude
  uninitialized garbage to get correct coderange.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15 07:23:38 +00:00
ktsj 9564e9bd23 * vm.c (invoke_block_from_c): fix unintentional block passing.
[ruby-dev:45071] [Bug #5832]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-12 03:04:42 +00:00
nobu 81a0c608eb compatible loader
* marshal.c (r_object0): also load TYPE_USRMARSHAL, TYPE_DATA using
  compatible loader.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04 02:40:30 +00:00
naruse d054eb9631 Add a test for r35863.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-02 13:44:02 +00:00
nobu 26f96fe1ce * test/-ext-/test_printf.rb: tests for [Feature #5896].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-25 02:20:36 +00:00
shirosaki 5ccee663e9 * include/ruby/win32.h (FD_SET): change function to macro.
To avoid buffer overflow when smaller FD_SETSISE is used in ext
  libraries.

* win32/win32.c (rb_w32_fdset): this function is not used anymore.
  But we leave this for compatibility.

* win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller
  FD_SETSISE is used in ext libraries. Dereference of fd_set pointer
  causes SEGV.

* test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for
  above.
* ext/-test-/win32/fd_setsize/depend: ditto.
* ext/-test-/win32/fd_setsize/extconf.rb: ditto.
* ext/-test-/win32/fd_setsize/fd_setsize.c: ditto.

  [ruby-core:44588] [Bug #6352]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08 12:47:25 +00:00
naruse 77321aeed9 win32/dln is only for win32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 11:14:24 +00:00
nobu dad31f6e50 * dln.c (rb_w32_check_imported): skip ordinal entries. based on a
patch by phasis68 (Heesob Park) at [ruby-core:44381].
  [ruby-core:44371][Bug #6303]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 04:11:17 +00:00
nobu f45fc7daa0 * error.c (rb_enc_raise): new function to raise an exception with
the message in the given encoding.  patched by now (Nikolai
  Weibull) at [ruby-core:41160].  [Feature #5650]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 10:07:07 +00:00
nobu 30cea65767 * st.c (st_update): add existing parameter to the callback function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29 07:36:12 +00:00
nobu f4aff7feb1 num2ll and num2ull
* ext/-test-/num2int/num2int.c (print_num2ll, print_num2ull): define
  only if long long is available, and use long long printf modifier
  checked by configure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-18 15:21:04 +00:00
nobu a73d958c33 * st.c: add st_foreach_check for fixing iteration over packed table
and st_delete_safe.  patched by Sokolov Yura at
  https://github.com/ruby/ruby/pull/84


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10 14:52:19 +00:00
nobu efae619458 * st.c: fix packed num_entries on delete_safe. patched by Sokolov
Yura at https://github.com/ruby/ruby/pull/84


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10 14:52:06 +00:00
nobu 5ee0135a2f * test/ruby/envutil.rb (assert_no_memory_leak): new assertion to
check memory leak by invoking child ruby process and watch its
  memory size.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 15:47:11 +00:00
nobu fc018c9b34 * test/-ext-/string/test_modify_expand.rb: test for r34492.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 13:35:27 +00:00
nobu cf1a22fdf9 * st.c (st_update): table can be unpacked in the callback.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-07 05:52:15 +00:00
nobu 97c3c98762 * st.c (st_foreach): should not yield same pair when checking
after unpacking.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-07 05:29:20 +00:00
nobu 04726dd749 * vm.c (rb_iter_break_value): new function to break a block with
the value.  [ruby-dev:45132] [Feature #5895]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-24 05:20:48 +00:00
ayumin 0713603b6f * test/-ext-/old_thread_select/test_old_thread_select.rb:
avoid platform bug. [Bug #5858] [ruby-dev:45108]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07 16:22:47 +00:00
nobu 2f6d8bdc94 * st.c (st_update): new function to lookup the given key and
update the value.  [ruby-dev:44998]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-27 13:04:30 +00:00
kazu 327ea26b59 * ext/bigdecimal/README: Update redmine.ruby-lang.org to bugs.ruby-lang.org
* ext/socket/ancdata.c: ditto
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb: ditto
* test/syck/test_yaml.rb: ditto
* doc/ChangeLog-1.9.3: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-20 16:09:17 +00:00
nobu 9dccfb5513 * error.c (rb_check_typeddata): refine error message with
including expected struct name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-15 05:33:34 +00:00
naruse aa432d2334 FreeBSD 9.0 RC3 is now released.
See also r33677, r33967, and r33973.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-14 00:28:26 +00:00
naruse 09c399b68e It is fixed in FreeBSD 9.0 RC3, not RC2.
So skip until it is released.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 22:13:04 +00:00
naruse 1b99ecc5a2 FreeBSD 9.0 RC2 fixes the bug.
FreeBSD PR: kern/155606, kern/162379

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07 00:32:37 +00:00
naruse f6f4534382 * variable.c (rb_path2class): don't raise NameError when the middle
constant of the path is not defined but defined on toplevel.
  [ruby-core:41410] [Bug #5691]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-30 14:44:06 +00:00
kosaki ed681d3a82 * bignum.c (rb_big2ull): fix 32bit platform breakage. we must
not assume sizeof(VALUE) == sizeof(LONG_LONG).
* test/-ext-/num2int/test_num2int.rb (class TestNum2int):
  fix false assumption on 32bit platform.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 05:56:09 +00:00
kosaki b2a2ba1191 * include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.
* numeric.c: ditto.

* test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT().
* ext/-test-/num2int/num2int.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:54:34 +00:00
kosaki d3437b7c1a * bignum.c (rb_big2ull): fix off-by-twice bug of NUM2ULL.
* test/-ext-/num2int/test_num2int.rb (class TestNum2int):
  fix a testcase too.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:51:56 +00:00
kosaki 11137bed53 * test/-ext-/num2int/test_num2int.rb (class TestNum2int):
add FIXNUM tests.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:47:21 +00:00
kosaki 74a13c7634 * numeric.c (check_uint): fix off-by-one bug of NUM2UINT.
* bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG.

* test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT()
  NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL().
* ext/-test-/num2int/depend: ditto.
* ext/-test-/num2int/extconf.rb: ditto.
* ext/-test-/num2int/num2int.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:45:47 +00:00
naruse 3d855def9e FreeBSD 8.2 sticks this [ruby-dev:44726] [Bug #5524]
http://redmine.ruby-lang.org/issues/5524

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 17:13:03 +00:00
naruse 632f448827 On some platforms, object_id can be negative value like NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01 00:42:41 +00:00
nobu 72cbec3f6d * util.c (mmprepare): fix for fragmental size.
* util.c (mmswap_, mmrot3_): portability improvement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-20 02:42:26 +00:00
nobu d5e7b3972c * test/-ext-/symbol/test_inadvertent_creation.rb (noninterned_name):
sigil of global, instance and class variable names should be
  followed by non-numeric.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-07 11:29:37 +00:00
nobu 881891fb2f * test/-ext-/symbol/test_inadvertent_creation.rb: moved tests from
test_module.rb and test_symbol.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-07 08:57:42 +00:00
nobu 89fef02f13 * vm_eval.c (make_no_method_execption): extract from
raise_method_missing().
* vm_eval.c (send_internal): remove inadvertent symbol creation
  from public_send.  based on a patch by Jeremy Evans <code AT
  jeremyevans.net> in [ruby-core:38576]. [Feature #5112]
* vm_insnhelper.c (vm_call_method): remove inadvertent symbol
  creation from send and __send__, too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-06 07:29:33 +00:00
kosaki d4db53a0e0 * test/-ext-/old_thread_select/test_old_thread_select.rb:
select() with timeout may return early in old Linux kernels
  with 250 Hz tickrate and no dynticks, so skip everything older
  than 2.6.32 (which has long term support).
  And, Make the timing assertions consistently use assert_operator with
  timing difference in error message
  Patch by Eric Wong. [Bug #5335] [ruby-core:39618]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-19 09:47:27 +00:00
kosaki 2c9375ba69 * thread.c (rb_thread_select): fix to ignore an argument
modification of rb_thread_fd_select().
  based on a patch by Eric Wong. [Bug #5306] [ruby-core:39435]
* thread.c (rb_fd_rcopy): New. for reverse fd copy.

* test/-ext-/old_thread_select/test_old_thread_select.rb
(test_old_select_false_positive): test for bug5306.

* ext/-test-/old_thread_select/old_thread_select.c (fdset2array):
  New. convert fdsets to array.
* ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
  return 'read', 'write', 'except' argument of rb_thread_select()
  to ruby script.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-12 11:36:06 +00:00
nobu 61b062ba6d * thread.c (rb_thread_select): fix a typo to initialize efds
properly.  [Bug #5299] [ruby-core:39380]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 01:22:06 +00:00
naruse 90c33c2198 Use assert_operator to show clear message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06 08:11:21 +00:00
usa 13a77870de * test/-ext-/old_thread_select/test_old_thread_select.rb
(TestOldThreadSelect#test_old_select_read_timeout): if the machine
  is fast enough, the time used by code around IO.select may be smaller
  than Time implement threshold.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:34:54 +00:00
usa 34e65bee79 * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
typo.

* test/-ext-/old_thread_select/test_old_thread_select.rb
  (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
  of SIGUSR1 because the former is general and the latter is platform
  dependent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:07:21 +00:00
kosaki 0cebfad20a * thread.c (rb_thread_select): rewrite by using
rb_thread_fd_select(). old one is EINTR unsafe.
  Patch by Eric Wong. [Bug #5229] [ruby-core:39102]

* test/-ext-/old_thread_select/test_old_thread_select.rb:
  a testcase for rb_thread_select().
* ext/-test-/old_thread_select/old_thread_select.c: ditto.
* ext/-test-/old_thread_select/depend: ditto.
* ext/-test-/old_thread_select/extconf.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:33:05 +00:00
usa f9e9eee677 * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
[Bug #5153] [ruby-core:38736]

* io.c (argf_next_argv): remove the call of above function.

* ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
  extension module because this is only for testsing ruby_add_suffix().

* LEGAL: remove the mention about a part of util.c, because now we
  removed the part.

* io.c (argf_next_argv): now the new filename is not guranteed to
  use, so should check the return value of rename(2).

* test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
  now we expect same result with other platforms on no_safe_rename
  platforms (=Windows).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 07:10:56 +00:00
nobu cfa0035962 * encoding.c (rb_enc_set_index, rb_enc_associate_index): should
check if frozen.
* parse.y (rb_intern3), ruby.c (process_options, ruby_script):
  defer freezing after associating encodings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07 06:44:46 +00:00
kosaki c06da4735d * thread.c (rb_wait_for_single_fd): Fix wrong return value.
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
(TestWaitForSingleFD#test_wait_for_closed_pipe): test for it.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04 10:02:06 +00:00