summaryrefslogtreecommitdiff
path: root/array.c
AgeCommit message (Collapse)Author
2009-02-04merge revision(s) 20103:shyouhei
* array.c (rb_ary_join): do not repeat self in a recursive array. [ruby-dev:37019] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@22056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01merge revision(s) 17756:shyouhei
* array.c (rb_ary_fill): check if beg is too big. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 * array.c (rb_ary_fill): (compatibility) do not raiseshyouhei
ArgumentError on negative length. This behaviour shall change in a future release. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29merge revision(s) 17570:shyouhei
* array.c (rb_ary_fill): not depend on unspecified behavior at integer overflow. reported by Vincenzo Iozzo <snagg AT openssl.it>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20merge revision(s) 17470:17472:shyouhei
* array.c (rb_ary_store, rb_ary_splice): not depend on unspecified behavior at integer overflow. * string.c (str_buf_cat): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19* array.c (ary_new, rb_ary_initialize, rb_ary_store,shyouhei
rb_ary_aplice, rb_ary_times): integer overflows should be checked. based on patches from Drew Yao <ayao at apple.com> fixed CVE-2008-2726 * string.c (rb_str_buf_append): fixed unsafe use of alloca, which led memory corruption. based on a patch from Drew Yao <ayao at apple.com> fixed CVE-2008-2726 * sprintf.c (rb_str_format): backported from trunk. * intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19* array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):nobu
Make Array#eql?, #hash, #== and #<=> use rb_protect_inspect() and handle recursive data properly. [ruby-dev:35181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19* array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):nobu
Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and handle recursive data properly. [ruby-dev:35181] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-07 * array.c (rb_ary_subseq): need integer overflow check.shyouhei
[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/branches/ruby_1_8_6@13399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-07 * array.c (rb_ary_fill): need integer overflow check.shyouhei
[ruby-dev:31738] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-22 * array.c (rb_ary_initialize): should call rb_ary_modify() first.shyouhei
[ruby-core:11562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-18* array.c (rb_ary_shift): shorten copy size. fixed: [ruby-list:42907]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-01* array.c (rb_ary_shift): should not move memory region if arraymatz
body is shared. a patch from Kent Sibilev <ksruby at gmail.com>. [ruby-core:08922] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-24* array.c (rb_ary_shift): should clear shifting top element.matz
[ruby-talk:216055] * array.c (rb_ary_shift): avoid creating shared object if array size is small. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-24comment rb_ary_new4 behavior in Ruby 1.9.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-03* ext/syck/emitter.c (syck_scan_scalar): avoid accessingmatz
uninitialized array element. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07809] * array.c (rb_ary_fill): initialize local variables first. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-04-26* array.c (rb_ary_fill): internalize local variable "beg" tomatz
pacify Coverity. [ruby-core:07770] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-22* array.c: document fix - remove reference of obsoletedmatz
select usage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12* array.c (rb_ary_diff): fix a GC problem on IA64 withakr
gcc 3.3.5 (Debian 1:3.3.5-13). When rb_ary_push is called, there was no register which contains `hash' but `&RHASH(hash)->tbl' instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-15* array.c (rb_ary_fill): previous commit disabled this usage:ocean
a = [0,1,2,3,4,5,6,7,8,9] a.fill {|i| a[i] * 10} #=> [nil, nil, ...., nil] previous commit has advantange for early garbage collection, but potensially would break some script. so I reverted behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-15* array.c (rb_ary_fill): tail elements were vanished when the middleocean
part of array was filled. (ie: [0,1,2,3,4].fill(-1,2,1) => [0,1,-1]) * test/ruby/test_array.rb (test_fill): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-15* array.c (rb_ary_fill): should adjust array length correctly whenmatz
an array is expanded in the fill process. [ruby-core:06625] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-14* array.c (rb_ary_first): RDoc update from Daniel Bergermatz
<djberg96@yahoo.com>. [ruby-core:06577]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-05* array.c (sort_2): get rid of yet another bcc's bug.nobu
fixed: [ruby-core:05152] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-13* array.c (rb_ary_select): can remove argc check. [ruby-core:4911]ocean
(patch from Daniel Berger) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-28* exception error messages updated. [ruby-core:04497]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-23* array.c (rb_ary_s_create): no need for negative argc check.matz
[ruby-core:04463] * array.c (rb_ary_unshift_m): ditto. * lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass of StandardError class, not Exception class. [ruby-core:04429] * lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE. fixed: [ruby-core:04444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-18* process.c (proc_getpgrp): prohibit for $SAFE=2.matz
[ruby-dev:24899] * process.c (get_pid): ditto. [ruby-dev:24904] * process.c (get_ppid): ditto. * array.c (rb_ary_delete): defer rb_ary_modify() until actual modification. [ruby-dev:24901] * parse.y (newline_node): should not use FL_SET. [ruby-dev:24874] * parse.y (string_content): should not use FL_UNSET. * node.h (NODE_NEWLINE): remove unused bit to utilize flag field in nodes. * string.c (rb_str_splice): move rb_str_modify() after StringValue(), which may alter the receiver. [ruby-dev:24878] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-16* numeric.c (flo_divmod): protect float values from GC bymatz
assignment to local variables. [ruby-dev:24873] * string.c (str_mod_check): frozen check should be separated. [ruby-core:3742] * array.c (rb_ary_update): pedantic check to detect rb_ary_to_ary() to modify the receiver. [ruby-dev:24861] * string.c (rb_str_justify): typo fixed. [ruby-dev:24851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-04* gc.c (gc_mark): enable GC stack checking.matz
* string.c (str_gsub): lock strings temporarily. [ruby-dev:24687] * ext/socket/socket.c (s_recvfrom): tmplock input buffer. [ruby-dev:24705] * array.c (rb_ary_uniq_bang): do not push frozen string from hash table. [ruby-dev:24695] * array.c (rb_ary_and): ditto. * array.c (rb_ary_or): ditto. * ext/enumerator/enumerator.c (each_cons_i): pass copy of an internal consequent array. [ruby-talk:118691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-30* string.c (rb_str_locktmp): lock string temporarily.matz
* string.c (str_independent): add tmplock check. * io.c (io_write): lock output string temporarily. [ruby-dev:24649] * io.c (io_write): use rb_str_locktmp(). * io.c (read_all): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-20* string.c (str_gsub): reentrant check. [ruby-dev:24432]matz
* backport all SEGV bug fixes from CVS HEAD. [ruby-dev:24536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-07* pack.c (pack_unpack): string conversion should at the top of thematz
method. [ruby-dev:24439] * io.c (io_read): buffer should be frozen only after the length check. [ruby-dev:24440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-02* string.c (rb_str_sum): check was done with false pointer.matz
[ruby-dev:24383] * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22* hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]matz
* st.c (st_foreach): add deep check. * array.c (rb_ary_collect_bang): element size might change during comparison. [ruby-dev:24300] * array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300] * array.c (rb_ary_eql): ditto. [ruby-dev:24300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-21* array.c (rb_ary_equal): merge miss.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-21* array.c (rb_ary_uniq_bang): element size might change duringmatz
comparison. [ruby-dev:24298] * enum.c (enum_sort_by): do not use qsort directly. use rb_ary_sort_bang() instead. [ruby-dev:24291] * enum.c (enum_sort_by): pedantic type check added. [ruby-dev:24291] * hash.c (rb_hash_foreach_iter): check iter_lev after each iteration. [ruby-dev:24289] * array.c (rb_ary_and): element size might change during comparison. [ruby-dev:24290] * array.c (rb_ary_or): ditto. [ruby-dev:24292] * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-18* array.c (rb_ary_equal): element size might change duringmatz
comparison. [ruby-dev:24254] * array.c (rb_ary_diff): ditto. [ruby-dev:24274] * array.c (rb_ary_select): ditto. [ruby-dev:24278] * array.c (rb_ary_delete): ditto. [ruby-dev:24283] * array.c (rb_ary_rindex): ditto. [ruby-dev:24275] * array.c (rb_ary_initialize): element size might change during initializing block. [ruby-dev:24284] * dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to the original directory when exception has caused in changing direcotry or within block. thanks to Johan Holmberg <holmberg@iar.se> [ruby-core:03446] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-24* range.c (rb_range_beg_len): returns Qnil only when "beg" pointsmatz
outside of a range. No boundary check for "end". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-13* array.c: rdoc patch - unified margin.ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-13* array.c: rdoc patch. merged patch from Johan Holmbergocean
<holmberg@iar.se> [ruby-core:3170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-09* array.c, enum.c, pack.c: rdoc patch from Johan Holmbergocean
<holmberg@iar.se> [ruby-core:3132] [ruby-core:3136] * numeric.c: rdoc patch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-14* array.c, enum.c, eval.c, file.c, io.c, numeric.c, object.c, prec.c,nobu
process.c, re.c, string.c: typos in RDoc comments. [ruby-core:02783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-05* eval.c (top_include): include in the wrapped load is done formatz
the wrapper, not for a singleton class for wrapped main. [ruby-dev:23305] * bignum.c (rb_big_eq): use temporary double variable to save the result (internal float register may be bigger than 64 bits, for example, 80 bits on x86). [ruby-dev:23311] * eval.c (block_pass): should generate unique identifier of the pushing block. [ruby-talk:96363] * ext/socket/socket.c (make_hostent): fix memory leak, based on the patch from HORIKAWA Hisashi <vzw00011@nifty.ne.jp>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-26Doug Kearns's doc. patchdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-30Add RDoc for kernel functions, and tidy updave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-29Tidy array.c rdocdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23Fix doc typosdave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-16Put RDoc comments into array.c, and refine rdoc/ri to deal with stuff that arosedave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-14* eval.c (rb_method_node): new API to retrieve method body.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e