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

9689 Коммитов

Автор SHA1 Сообщение Дата
matz 9df2b5fd0c * array.c (rb_ary_subseq): need integer overflow check.
[ruby-dev:31736]

* array.c (rb_ary_splice): ditto.  [ruby-dev:31737]

* array.c (rb_ary_fill): ditto.  [ruby-dev:31738]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-05 13:37:18 +00:00
matz c349959778 * string.c (rb_str_splice): integer overflow for length.
[ruby-dev:31739]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-05 13:06:01 +00:00
suke 9ecd43fa98 * ext/win32ole/win32ole.c: add WIN32OLE_EVENT#unadvise.
* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-04 11:48:53 +00:00
nobu 1acdd51cf9 * common.mk (vm.o): depends on st.h too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-03 06:37:11 +00:00
akr 15c8e4618b * include/ruby/st.h (struct st_table): make num_entries bitfield
instead of num_bins for speed.  num_entries has less access.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-02 14:40:47 +00:00
akr 96c859834e add a test for [ruby-dev:31709].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-02 06:39:58 +00:00
matz e8959acc9f ChangeLog: typo fixed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 15:57:22 +00:00
tadf ec6cf1f454 * lib/date/format.rb (_parse): improved parsing of ordinal dates.
* lib/date/format.rb (_parse): use named character classes in some
	  regular expressions.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 15:47:52 +00:00
usa ebef450d28 * test_jump.rb, test_knownbug.rb: seems to be fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 14:56:59 +00:00
matz 87fe4d4913 * eval_jump.ci (rb_f_throw): wrap tag and TAG_THROW in a NODE_MEMO
node to make throw instruction to work well.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 14:46:00 +00:00
usa 6c7466e82a * bootstraptest/test_knownbug.rb: add new test. [ruby-dev:31698]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 14:15:05 +00:00
matz 49be22d8df * eval_jump.ci (rb_f_catch): generate new tag object if no argument is
given.  backported from MatzRuby.  [ruby-dev:31609]

* eval_jump.ci (rb_catch): call #catch without arguments if tag
  string is NULL.

* eval_jump.ci (rb_f_throw): allow throwing non-symbol object.

* eval.c (rb_catch_obj): new function to wait throw with arbitrary
  object. 

* eval.c (rb_throw_obj): new function to throw arbitrary object.

* variable.c (check_autoload_table): prevent multiple calls from
  RSTRING_PTR().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 12:56:29 +00:00
akr 2c8e7a50c1 * include/ruby/ruby.h (struct RBignum): embed digits in RBignum for
small bignums.

* bignum.c: RBignum embeded digits implemented.

* include/ruby/intern.h: declare rb_big_resize.

* gc.c: don't free embedded digits.

* numeric.c: replace direct bignum field accessor by abstract field
  accessor such as RBIGNUM(val)->sign to RBIGNUM_SIGN(val).

* sprintf.c: ditto.

* compar.c: ditto.

* marshal.c: ditto.

* random.c: ditto.

* .gdbinit: support embedded small bignums.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 12:02:36 +00:00
suke 0c5e6ab2bb * ext/win32ole/win32ole.c (ole_event_free): IConnectionPoint should be
released.

* ext/win32ole/win32ole.c (EVENTSINK_Destructor): ITypeInfo should be
  released.

* ext/win32ole/win32ole.c (fev_initialize): refactoring.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 11:11:51 +00:00
usa 1588a79069 * test/socket/test_tcp.rb (test_recvfrom): same as mswin32 on mswin64.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 07:27:26 +00:00
nobu ec2beed3b2 * include/ruby/st.h (rb_index_t): use st_data_t for the platforms it
is larger than int.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 05:24:25 +00:00
nobu d4cbf95002 * st.c (st_numcmp, st_numhash): use st_data_t instead of long, because
the former may be larger than the latter.

* include/ruby/st.h (CHAR_BIT): get rid of magic number.

* include/ruby/st.h (struct st_table): num_entries never exceed
  num_bins.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01 02:14:40 +00:00
akr b39e00d39d fix comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-31 07:20:38 +00:00
usa 6cca1f4c6a * numeric.c (SQRT_LONG_MAX): use SIZEOF_LONG instead of SIZEOF_VALUE
because SIZEOF_VALUE > SIZEOF_LONG on some platforms.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 22:15:07 +00:00
nobu 6a9b9f488b * parse.y (f_norm_arg, f_arg_item): not croak already erred names.
[ruby-dev:31687]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 19:18:05 +00:00
nobu 7aaf7dac8d * parse.y (assignable_gen): ignore already erred names.
* parse.y (shadowing_lvar_gen): always make new block local variable
  when shadowing outer local variable.  [ruby-dev:31507]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 18:49:00 +00:00
usa 70f5d818f8 * regenc.h: check RUBY_EXTERN before including config.h and defines.h
* common.mk: update header dependency.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 10:42:09 +00:00
nobu 7d4ee1d235 * proc.c (rb_obj_define_method): reverted. [ruby-talk:266637]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 05:06:52 +00:00
nobu 18c9e590c3 * lib/mkmf.rb: initialize $top_srcdir always. [ruby-dev:31682]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 04:49:27 +00:00
nobu 10084a3e61 * lib/mkmf.rb (try_const, have_const): check for a const is defined.
[ruby-core:04422]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 04:13:16 +00:00
nobu b58f080349 * string.c (tr_trans, rb_str_squeeze_bang, rb_str_split_m): suppress
warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 02:44:20 +00:00
akr c8b8b7438e add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 01:54:51 +00:00
akr 2b18d1ee8e * hash.c (hash_alloc0, hash_alloc): unified because hash_alloc doesn't
allocate st_table now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 00:41:24 +00:00
akr 1591776d46 forgot to modify
ext/json/ext/parser/parser.rl and
ext/tk/tkutil/tkutil.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 23:38:38 +00:00
akr eee95e67b9 enclose RHASH_XXX macros by parenthesis.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 23:16:55 +00:00
akr 2a4c4f7b0c * include/ruby/intern.h: declare rb_hash_tbl.
* include/ruby/ruby.h (RHash): delay st_table allocation.
  rename tbl field to ntbl to detect direct reference to the st_table
  as a compile error.
  (RHASH_TBL): abstract accessor defined.
  (RHASH_ITER_LEV): ditto.
  (RHASH_IFNONE): ditto.
  (RHASH_SIZE): ditto.
  (RHASH_EMPTY_P): ditto.

* hash.c: delay st_table allocation.

* gc.c: replace tbl by ntbl.

* array.c: replace direct field accessor by abstract field accessor
  such as RHASH(hash)->tbl to RHASH_TBL(hash).

* marshal.c: ditto.

* insns.def: ditto.

* ext/iconv/iconv.c: ditto.

* ext/json/ext/generator/generator.c: ditto.

* ext/json/ext/parser/parser.c: ditto.

* ext/syck/rubyext.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 23:12:21 +00:00
matz 3d7f8c2320 * string.c (str_gsub): should not use mbclen2() which has broken API.
* re.c: remove rb_reg_mbclen2().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 19:16:02 +00:00
akr 24385e708e * lib/open-uri.rb: add :ftp_active_mode option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 09:38:36 +00:00
akr 089cfabaf0 add test for [ruby-dev:31609].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 06:54:56 +00:00
nobu 2656b0545e * parse.y (aref_args): args may not be a list. [ruby-dev:31592]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 03:48:19 +00:00
nobu 69099d3e69 * re.c (rb_reg_mbclen2): suppress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 03:19:00 +00:00
akr 167358d000 * include/ruby/st.h (struct st_table): add entries_packed 1-bit
bitfield.  decrease num_bins 1-bit.

* st.c: pack numhash which have 5 or less entries in bins.
  (st_init_table_with_size): setup entries_packed flag.
  (st_clear): support packed mode.
  (st_lookup): ditto.
  (st_insert): ditto.
  (st_add_direct): ditto.
  (st_copy): ditto.
  (st_delete): ditto.
  (st_foreach): ditto.
  (st_reverse_foreach): ditto.
  (unpack_entries): new function for converting to unpacked mode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 02:36:54 +00:00
matz 3783246a2e * include/ruby/defines.h (flush_register_windows): call "ta 0x03"
even on Linux/Sparc.  [ruby-dev:31674]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29 02:15:03 +00:00
suke 41585e424b * ext/win32ole/win32ole.c (ole_type_progid): progid getted by
ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton.

* test/win32ole/test_win32ole.rb (test_raise_message): set negative
  compareMode value to raise WIN32OLERuntimeError.

* test/win32ole/test_win32ole_type.rb (test_implemented_ole_types):
  support some environment which returns IShellDispatch5 instead 
  of IShellDispatch.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-28 10:23:31 +00:00
matz 51b4cc11d1 * string.c (rb_str_subseq): retrieve substring based on byte offset.
* string.c (rb_str_rindex_m): was confusing character offset and
  byte offset.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-28 06:45:32 +00:00
nobu 01c24a2f78 * test/ruby/test_string.rb (test_splice!): tests for [ruby-dev:31665].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-28 06:19:11 +00:00
nobu 53635dea12 * string.c (rb_str_splice_0): should check to modify. [ruby-dev:31665]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-28 05:23:33 +00:00
nobu 38b1f98a72 * parse.y (parser_prepare): set parser encode too when BOM exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-28 05:21:48 +00:00
ko1 88f13dfc72 remove conflict sign.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 16:52:23 +00:00
ko1 6244e502cc * thread.c: fix Mutex to be interruptable lock.
* thread_win32.ci, thread_win32.h, thread_pthread.ci, thread_pthread.h:
  prepare native_cond_*() which are based on pthread_cond_*() spec.
* prelude.rb: fix Mutex#synchronize method.
* vm_core.h, include/ruby/intern.h: change unblock function interface
  (to pass some user data).
* file.c, process.c: ditto.
* benchmark/bm_vm2_mutex.rb: add a benchmark for mutex.
* benchmark/bm_vm3_thread_mutex.rb: add a benchmark for mutex
  with contension.
* benchmark/run.rb: fix to remove ENV['RUBYLIB'] for matzruby.
* test/ruby/test_thread.rb: add a test.
* common.mk: fix benchmark options.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 16:48:14 +00:00
matz 51fb5511e0 * string.c (rb_str_each_line): should swallow sequence of newlines
if rs (optional argument) is an empty string.  [ruby-dev:31652]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 14:32:15 +00:00
matz 9166bd2bc9 * string.c (rb_str_rstrip_bang): wrong strip point. [ruby-dev:31652]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 14:17:28 +00:00
matz 4461bd2f1f * encoding.c (rb_enc_codelen): raises invalid sequence exception
if ONIGENC_CODE_TO_MBCLEN() returns zero.  [ruby-dev:31661]

* encoding.c (rb_enc_mbclen): check invalid sequence.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 13:48:09 +00:00
suke a1a618ead1 * ext/win32ole/win32ole.c (ole_type_progid): fix the bug.
[ruby-dev:31576]

* test/win32ole/test_win32ole_type.rb (test_initialize):
  remove duplicate assertions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 11:38:29 +00:00
matz fd618e2234 * ext/etc/etc.c (etc_getlogin): update documentation to note
security issue.  [ruby-Bugs-11821]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27 10:15:18 +00:00