normalizing the result. x should be a big number.
[ruby-dev:26778]
* bignum.c (rb_big_pow): use rb_big_mul0() instead of
rb_big_mul().
* array.c (rb_ary_or, rb_ary_and, rb_ary_plus, rb_ary_diff):
revert the change on 2005-08-03. Set operation on other item
should have in separate methods.
* parse.y (shadowing_lvar_gen): warn when arguments shadows
external local variables.
* parse.y (f_opt): optional arguments should not clobber external
local variables.
* parse.y (f_rest_arg): rest arguments should not clobber external
local variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
suggested by Bertram Scharpf <lists@bertram-scharpf.de> in
[ruby-talk:134083].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_exec_recursive() in eval.c.
* eval.c (rb_exec_recursive): new function.
* array.c (rb_ary_join): use rb_exec_recursive().
* array.c (rb_ary_inspect, rb_ary_hash): ditto.
* file.c (rb_file_join): ditto.
* hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto.
* io.c (rb_io_puts): ditto.
* object.c (rb_obj_inspect): ditto
* struct.c (rb_struct_inspect): ditto.
* lib/set.rb (SortedSet::setup): a hack to shut up warning.
[ruby-talk:132866]
* lib/time.rb (Time::strptime): add new function. inspired by
[ruby-talk:132815].
* lib/parsedate.rb (ParseDate::strptime): ditto.
* regparse.c: move st_*_strend() functions from st.c. fixed some
potential memory leaks.
* exception error messages updated. [ruby-core:04497]
* ext/socket/socket.c (Init_socket): add bunch of Socket
constants. Patch from Sam Roberts <sroberts@uniserve.com>.
[ruby-core:04409]
* array.c (rb_ary_s_create): no need for negative argc check.
[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]
* parse.y (fcall_gen): lvar(arg) will be evaluated as
lvar.call(arg) when lvar is a defined local variable. [new]
* object.c (rb_class_initialize): call inherited method before
calling initializing block.
* eval.c (rb_thread_start_1): initialize newly pushed frame.
* lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE.
fixed: [ruby-core:04444]
* eval.c (is_defined): NODE_IASGN is an assignment.
* ext/readline/readline.c (Readline.readline): use rl_outstream
and rl_instream. [ruby-dev:25699]
* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check
[ruby-dev:25675]
* misc/ruby-mode.el: [ruby-core:04415]
* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]
* lib/rdoc/generators/ri_generator.rb: ditto.
* struct.c (make_struct): fixed: [ruby-core:04402]
* ext/curses/curses.c (window_color_set): [ruby-core:04393]
* ext/socket/socket.c (Init_socket): SO_REUSEPORT added.
[ruby-talk:130092]
* object.c: [ruby-doc:818]
* parse.y (open_args): fix too verbose warnings for the space
before argument parentheses. [ruby-dev:25492]
* parse.y (parser_yylex): ditto.
* parse.y (parser_yylex): the first expression in the parentheses
should not be a command. [ruby-dev:25492]
* lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330]
* object.c (Init_Object): remove Object#type. [ruby-core:04335]
* st.c (st_foreach): report success/failure by return value.
[ruby-Bugs-1396]
* parse.y: forgot to initialize parser struct. [ruby-dev:25492]
* parse.y (parser_yylex): no tLABEL on EXPR_BEG.
[ruby-talk:127711]
* document updates - [ruby-core:04296], [ruby-core:04301],
[ruby-core:04302], [ruby-core:04307]
* dir.c (rb_push_glob): should work for NUL delimited patterns.
* dir.c (rb_glob2): should aware of offset in the pattern.
* string.c (rb_str_new4): should propagate taintedness.
* env.h: rename member names in struct FRAME; last_func -> callee,
orig_func -> this_func, last_class -> this_class.
* struct.c (rb_struct_set): use original method name, not callee
name, to retrieve member slot. [ruby-core:04268]
* time.c (time_strftime): protect from format modification from GC
finalizers.
* object.c (Init_Object): remove rb_obj_id_obsolete()
* eval.c (rb_mod_define_method): incomplete subclass check.
[ruby-dev:25464]
* gc.c (rb_data_object_alloc): klass may be NULL.
[ruby-list:40498]
* bignum.c (rb_big_rand): should return positive random number.
[ruby-dev:25401]
* bignum.c (rb_big_rand): do not use rb_big_modulo to generate
random bignums. [ruby-dev:25396]
* variable.c (rb_autoload): [ruby-dev:25373]
* eval.c (svalue_to_avalue): [ruby-dev:25366]
* string.c (rb_str_justify): [ruby-dev:25367]
* io.c (rb_f_select): [ruby-dev:25312]
* ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072]
* struct.c (make_struct): [ruby-dev:25249]
* dir.c (dir_open_dir): new function. [ruby-dev:25242]
* io.c (rb_f_open): add type check for return value from to_open.
* lib/pstore.rb (PStore#transaction): Use the empty content when a
file is not found. [ruby-dev:24561]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_update): a[n,m]=nil no longer works as element
deletion.
* enum.c (enum_sort_by): protect continuation jump in.
[ruby-dev:24642]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-talk:117841]
* ruby.h (FL_ABLE): nodes are not subject for flag operations.
* io.c (ARGF_FORWARD): should have specified argv explicitly,
since we no longer have frame->argv saved. [ruby-dev:24602]
* string.c (RESIZE_CAPA): check string attribute before modifying
capacity member of string structure. [ruby-dev:24594]
* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
performance. [ruby-talk:117701]
* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
arguments, unless (digit)$ style used.
* io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in
interpreter termination. [ruby-dev:24579]
* eval.c (frame_free): Guy Decoux solved the leak problem.
Thanks. [ruby-core:03549]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the class of right operand. [ruby-dev:24526]
* ext/zlib/zlib.c (zstream_detach_buffer): should not expose
class-less object to Ruby world. [ruby-dev:24530]
* eval.c (proc_dup): provide Proc#dup as well. [ruby-talk:116915]
* eval.c (ruby_exec): stack marking position may be higher than
expected. thanks to Guy Decoux. [ruby-core:03527]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_flags_mode): requires output buffer no more. no
allocation needed.
* array.c (rb_ary_index): takes a block to compare items in an
array. [ruby-talk:113069] [Ruby2]
* array.c (rb_ary_rindex): ditto.
* marshal.c (r_byte): retrieve pointer from string value for each
time. [ruby-dev:24404]
* marshal.c (r_bytes0): ditto.
* enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399]
* io.c (io_read): should freeze all reading buffer.
[ruby-dev:24400]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-dev:24348]
* array.c (rb_ary_fill): fill should honor length argument.
[ruby-dev:24346]
* array.c (rb_ary_replace): should not use ptr from shared array.
[ruby-dev:24345]
* ext/socket/socket.c (s_accept): don't retry for EWOULDBLOCK.
[ruby-talk:113807]
* array.c (flatten): element size might change during comparison.
[ruby-dev:24343]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[llama@u01.gate0]
* parse.y (rb_parser_while_loop): ditto.
* array.c (rb_ary_subseq): original object might be modified after
sharing data creation. [ruby-dev:24327]
* array.c (rb_ary_replace): ditto.
* array.c (ary_make_shared): freeze shared array. [ruby-dev:24325]
* struct.c (struct_members): always check struct size and size of
members list in the class. [ruby-dev:24320]
* string.c (rb_str_sub_bang): check if string is not modified
during iteration. [ruby-dev:24315]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
size. [ruby-dev:24273]
* parse.y: make ruby parser reentrant. merge ripper parser to the
real one. this change makes ruby require bison.
* file.c (rb_file_truncate): clear stdio buffer before truncating
the file. [ruby-dev:24191]
* ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
which might return singleton class. [ruby-dev:24202]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_pop_m, rb_ary_shift_m): take arg to behave as push
and unshift.
* array.c (rb_ary_first, rb_ary_last): make shared array for result
array, and correct doc for Array#first(n) and Array#last(n)
* array.c (rb_ary_select): not accept any arg.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: ditto.
* ext/dbm/dbm.c: remove #indexes, #indices, "values_at" warning
from #select.
* ext/gdbm/gdbm.c: ditto.
* ext/sdbm/init.c: ditto.
* ext/dbm/dbm.c (Init_dbm): set VERSION constant as "unknown" when
DB_VERSION_STRING is not available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is same to @end. [ruby-talk:100269]
* string.c (rb_str_new4): should not reuse frozen shared string if
the original is not an instance of String. [ruby-talk:100193]
* time.c (time_mdump): preserve GMT bit in the marshal data.
[ruby-talk:100213]
* eval.c (is_defined): do not protect exception during receiver
evaluation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unnecessary line trace for inlined expression.
(ruby-bugs PR#1320)
* numeric.c (flo_to_s): tweak output string based to preserve
decimal point and to remove trailing zeros. [ruby-talk:97891]
* string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM
search. [ruby-talk:97342]
* hash.c (rb_hash_equal): returns true if two hashes have same set
of key-value set. [ruby-talk:97559]
* hash.c (rb_hash_eql): returns true if two hashes are equal and
have same default values.
* string.c (rb_str_equal): always returns true or false, never
returns nil. [ruby-dev:23404]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
path object is not a string. [Ruby2]
* gc.c (rb_gc_call_finalizer_at_exit): do not free threads in the
exit finalizers.
* io.c (rb_io_reopen): should use rb_io_check_io().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-talk:95409]
* eval.c (rb_f_raise): should not clear backtrace information if
exception object already have one.
* parse.y (assoc_list): allow {sym: val} style Hash. [Ruby2]
this change is done by Nobuyoshi Nakada <nobu@ruby-lang.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
one defined in object.c.
* object.c (Init_Object): remove Kernel#to_a.
* enum.c (enum_zip): use "to_a" instead of "to_ary".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
evaluation. [ruby-dev:21834]
* hash.c (rb_hash_fetch): always warn if default argument and a
block are supplied at the same time. [ruby-dev:21842]
* hash.c (env_fetch): ditto.
* array.c (rb_ary_fetch): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
system's alloca. [ruby-core:01503]
* io.c (rb_f_gets): should call next_argv() before type check
current_file. [ruby-list:38336]
* eval.c (proc_invoke): should retrieve retval when pcall is true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
need to restore previous value. [ruby-talk:77577]
* array.c (rb_ary_fill): array length may be changed during the
block execution. [ruby-talk:77579]
* array.c (rb_ary_zip): ditto.
* array.c (rb_ary_fill): ditto.
* hash.c (env_reject_bang): length may be changed during the block
execution.
* hash.c (env_clear): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
iteration. reported on [ruby-talk:77500], and fixed by
K.Sasada <ko1@namikilab.tuat.ac.jp> on [ruby-talk:77504]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_ary_values_at. follow DRY principle.
* re.c (match_values_at): values_at should understand ranges.
* struct.c (rb_struct_values_at): ditto.
* struct.c (inspect_struct): inspect format changed; add "struct "
at the top.
* sprintf.c (rb_f_sprintf): "%p" specifier for inspect output.
(RCR#68)
* eval.c (rb_mod_undef_method): allow "undef_method" to accept
multiple arguments. (RCR#146)
* lib/timeout.rb: put timeout in Timeout module. (RCR#121)
[ruby-talk:61028]
* re.c (match_groups): new method added. (RCR#139)
* variable.c (rb_mod_const_of): should exclude constant defined
in Object, unless retrieving constants of Object.
* string.c (rb_str_new4): do not allocate new string if original
is frozen or already have copy-on-write entry. [ruby-talk:74940]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Each END proc should preserve its own $SAFE level. [ruby-core:01119]
* marshal.c (marshal_load): remove unused variable "hash".
[ruby-core:01120]
* hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860]
* array.c (rb_ary_first): optional argument to retrieve first n
elements.
* array.c (rb_ary_last): optional argument to retrieve last n
elements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ranges too.
* range.c (rb_range_beg_len): length calculation was wrong.
* eval.c (rb_call): should set T_ICLASS in the frame->last_class.
[ruby-core:01110]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
before detach pid. [ruby-talk:71519]
* eval.c (PUSH_FRAME): save outer ruby_block. [ruby-list:37677],
[ruby-dev:20202]
* eval.c (BEGIN_CALLARGS): restore outer block by using
ruby_block->outer.
* eval.c (block_pass): do not alter block->prev, but block->outer.
* array.c (get_inspect_tbl): warning on wrong condition.
* eval.c (localjump_xvalue): renamed exitstatus to exit_value
since it's not exit "status" after all.
* eval.c (localjump_error): add reason to LocalJumpError.
* compar.c (rb_cmpint): raise error via rb_cmperr(), if cmp value
is nil. now take new 2 arguments.
* time.c (time_cmp): 2003-05-16 fix was incomplete.
(ruby-bugs-ja:PR#458)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
since it works as copy constructor.
* eval.c (rb_add_method): initialize_copy should always be
private, like initialize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
valid array. (ruby-bugs-ja PR#65)
* array.c (inspect_ensure,rb_protect_inspect,rb_inspecting_p):
use get_inspect_tbl().
* eval.c (rb_f_abort): call exit(1) if exception is raised. This
patch was made by Nobuyoshi Nakada <nobu.nokada@softhome.net> on
2002-05-30. (ruby-bugs-ja PR#236)
* signal.c: disable Ruby's interrupt handler at the beginning.
(ruby-bugs-ja PR#236)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_hash_values_at,env_values_at): ditto.
* re.c (match_values_at): ditto.
* struct.c (rb_struct_values_at): ditto.
* re.c (match_select): add iterator behavior.
* ext/curses/curses.c, ext/digest/sha2/sha2.c, ext/iconv/iconv.c,
ext/racc/cparse/cparse.c: include "ruby.h" at the top to shut up
"_FILE_OFFSET_BITS redefined" warning on Solaris.
* class.c (rb_class_protected_instance_methods): now gives
warnings to show migration path. The default will be reversed
on Jan 2004.
* numeric.c (num_step): "1.1.step(1.5,0.1)" to work.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
pad string. [ruby-talk:70482]
* string.c (rb_str_rjust): ditto.
* string.c (rb_str_center): ditto.
* string.c (rb_str_justify): utility function.
* eval.c (rb_add_method): call singleton_method_added or
method_added for every method definition (after ruby_running).
[ruby-talk:70471]
* array.c (rb_ary_reverse_bang): Array#reverse! should not return
nil even for arrays sized less than 2.
* io.c (argf_eof): should not block after reading all argument
files. (ruby-bugs-ja PR#449)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-list:37217]
* array.c (rb_ary_aset): raise TypeError if index is a symbol.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
receiver is an instance of subclass of Array.
* string.c (rb_str_to_s): return value should be a String if the
receiver is an instance of subclass of String.
* eval.c (rb_call): calls method_missing when superclass method
does not exist.
* eval.c (rb_f_missing): now handles "no super" case.
* object.c (rb_obj_ivar_get): Object#instance_variable_get: new
method to get instance variable value without eval(). [new]
* object.c (rb_obj_ivar_set): Object#instance_variable_set: new
method to set instance variable value without eval(). [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
object, if b has "to_ary" and b == a.
* hash.c (rb_hash_equal): a == b is true when b is non T_HASH
object, if b has "to_hash" and b == a.
* string.c (rb_str_equal): a == b is true when b is non T_STRING
object, if b has "to_str" and b == a.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
internally.
* re.c (rb_reg_initialize_m): should honor option status of
original regexp.
* array.c (rb_ary_equal): ary2 should be T_ARRAY (no to_ary
conversion).
* array.c (rb_ary_eql): ditto.
* string.c (rb_str_equal): str2 should be T_STRING (no to_str
conversion).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c (Init_Exception): "to_str" removed.
* eval.c (eval): should not rely on Exception#to_str
* eval.c (compile_error): ditto.
* error.c (err_append): ditto.
* hash.c (rb_hash_merge): Hash#merge, non destructive "update".
now there's also Hash#merge! which is an alias to "update".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (env_shift): ditto.
* hash.c (env_invert): ditto.
* hash.c (env_replace): ditto.
* hash.c (env_update): ditto.
* array.c (rb_ary_join): dispatch based on "to_str".
* array.c (rb_ary_times): ditto.
* array.c (rb_ary_equal): ditto.
* process.c (rb_f_exec): dispatch based on "to_ary".
* eval.c (umethod_bind): exact class match is not required. relax
the restriction to subclasses.
* eval.c (rb_eval): call "inherited" before executing class body.
* class.c (rb_define_class): call "inherited" after defining the
constant.
* class.c (rb_define_class_under): ditto.
* eval.c (massign): expand first element if RHS is an array and
its size is 1, and LHS has concrete assignment target (i.e. LHS
has target(s) other than *var).
* eval.c (massign): avoid unnecessary avalue/svalue conversion.
* eval.c (rb_yield_0): ditto
* array.c (rb_ary_update): do not allocate unused array if rpl is
nil (i.e. merely removing elements).
* io.c (io_read): should resize supplied string if it's shorter
than expected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mvalue, etc.
* eval.c (rb_yield_0): new parameter added to tell whether val is
an array value or not.
* parse.y (yield_args): restructuring: new nodes: NODE_RESTARY2,
NODE_SVALUE; removed node: NODE_RESTARGS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_s_chmod): Do not directly cast an int to void *
to avoid a warning.
* defines.h (FLUSH_REGISTER_WINDOWS): Add support for
FreeBSD/sparc64. miniruby still coredumps in a different place,
though.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (cmd_brace_block): new tLBRACE_ARG block rule
* parse.y (command): can take optional cmd_brace_block; use %prec
to resolve shift/reduce conflict. (ruby-bugs-ja PR#372)
* eval.c (ruby_finalize): trace_func should be cleared here (after
executing exit procs and finalizers).
* eval.c (rb_define_alloc_func): new allocation framework, based
on Nobu's work [ruby-dev:19116]. "allocate" method is no longer
used for object allocation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_check_array_type): new function: return an array
(convert if possible), or nil.
* string.c (rb_check_string_type): new function: return a string
(convert if possible), or nil.
* numeric.c (rb_dbl_cmp): returns nil if values are not
comparable.
* numeric.c (fix_cmp,flo_cmp): use rb_num_coerce_cmp()
* bignum.c (rb_big_cmp): ditto.
* numeric.c (rb_num_coerce_cmp): new coercing function for "<=>",
which does not raise TypeError.
* numeric.c (do_coerce): can be supress exception now.
* object.c (rb_mod_cmp): should return nil for non class/module
objects.
* re.c (rb_reg_eqq): return false if the argument is not a
string. now returns boolean value.
* class.c (rb_include_module): argument should be T_MODULE, not
T_class, nor T_ICLASS.
* eval.c (is_defined): "defined?" should return "assignment" for
attribute assignment (e.g. a.foo=b) and indexed assignment
(e.g. a[2] = 44).
* parse.y (aryset): use NODE_ATTRASGN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
still left; removed.
* sprintf.c (rb_f_sprintf): should not prepend '0' if width > prec
for example "%5.3d".
* process.c (Init_process): add Process.exit and Process.abort
* pack.c (utf8_to_uv): raise ArgumentError for malformed/redundant
UTF-8 sequences.
* process.c (last_status_set): add pid attribute to Process::Status.
* pack.c (uv_to_utf8): limit maximum length of the encoded string
to 6 bytes, even when the platform supports 8 bytes long integers.
* pack.c (utf8_to_uv): do not decode sequences longer than 6 bytes.
* object.c (copy_object): use "copy_object" method, not "become".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
empty path, just ignore.
* dir.c: remove <sys/parm.h> inclusion.
* compar.c (cmp_eq,cmp_gt,cmp_ge,cmp_lt,cmp_le): check using
rb_cmpint().
* error.c (init_syserr): remove sys_nerr dependency.
* numeric.c (num_cmp): added to satisfy Comparable assumption.
* eval.c (rb_add_method): "initialize" should be public if it is a
singleton method.
* regex.c (re_match): avoid dereferencing if size == 0.
(ruby-bugs-ja:PR#360)
* time.c (time_cmp): should return nil if an operand is not a
number nor time. (ruby-bugs-ja:PR#359)
* file.c (rb_stat_cmp): should return nil if an operand is not
File::Stat.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
zipped with nil if argument arrays are shorter. if arrays are
longer, left items are ignored. now works with blocks.
* enum.c (zip_i): changed for new behavior.
* array.c (rb_ary_transpose): added. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
variable table if it existes.
* class.c (rb_make_metaclass): metaclass of a metaclass is a
metaclass itself.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_alias): prohibit making an alias named "allocate" if
klass is a metaclass.
* string.c (rb_string_value_ptr): StringValuePtr() should never
return NULL pointer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_find_file_ext): ditto.
* range.c (range_eq): class check should be based on range.class,
instead of Range to work with Range.dup.
* range.c (range_eql): ditto.
* class.c (rb_mod_dup): need to preserve metaclass and flags.
* object.c (rb_cstr_to_dbl): had a buffer overrun.
* marshal.c (w_class): integrate singleton check into a funciton
to follow DRY principle.
* marshal.c (w_uclass): should check singleton method.
* object.c (rb_obj_dup): dmark and dfree functions must be match
for T_DATA type.
* object.c (rb_obj_dup): class of the duped object must be match
to the class of the original.
* re.c (rb_reg_quote): do not escape \t, \f, \r, \n, for they are
not regular expression metacharacters.
* time.c (time_s_alloc): use time_free instead of free (null check,
also serves for type mark).
* time.c (time_s_at): check dfree function too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_hash_dup): should preserve HASH_PROC_DEFAULT and
HASH_DELETED flags.
* hash.c (rb_hash_shift): shift from empty hash should not return
its default proc.
* hash.c (rb_hash_default_proc): new method. [new]
* array.c (rb_ary_aref): no need for Bignum check.
* array.c (rb_ary_aset): explicit Bignum check removd.
* numeric.c (fix_aref): normalize bignum before bit-op.
* bignum.c (rb_big_rand): max may be Bignum zero.
* bignum.c (rb_cstr_to_inum): should normalize bignums, to avoid
returning fixable bignum value.
* bignum.c (rb_uint2big): there should be no zero sized bignum.
* ext/extmk.rb.in: extmake() that works properly for both tkutil
(tk/tkutil.so) and digest/sha1.
* hash.c (rb_hash_equal): should check HASH_PROC_DEFAULT too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
substring, slice! should return nil without exception.
* array.c (rb_ary_insert): type fixed.
* string.c (rb_str_split_m): accept separator value nil as well.
* string.c (rb_str_become): was leaking memory.
* class.c (rb_include_module): should not alter other
classes/modules by inclusion. by this fix, local order may not
be preserved for some cases.
* class.c (include_class_new): module may be T_ICLASS; retrieve
original module information.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (rb_io_mode_modenum): ditto.
* gc.c (rb_memerror): rename from mem_error, and exported.
* gc.c (Init_GC): pre-allocate NoMemoryError instance.
* object.c (convert_type): error message changed from "failed to
convert" to "cannot convert", since it does not try to convert
if an object does not respond to the converting method.
* eval.c (block_pass): convert Method to Proc using
rb_check_convert_type().
* object.c (rb_check_convert_type): always convert T_DATA
* eval.c (rb_thread_cleanup): should not terminate main_thread by
Fatal error.
* regex.c (is_in_list): need to not exclude NUL and NEWLINE.
* re.c (rb_reg_expr_str): wrong backslash escapement.
* re.c (rb_reg_expr_str): do not escape embedded space
characters.
* marshal.c (w_object): T_DATA process patch from Joel VanderWerf
<vjoel@PATH.Berkeley.EDU>. This is temporary hack; it remains
undocumented, and it will be removed when marshaling is
re-designed.
* marshal.c (r_object): ditto.
* numeric.c (num_step): Integer#step is moved to Numeric#step;
Fixnum#step is merged into this method.
* numeric.c (int_dotimes): Fixnum#times is merged.
* numeric.c (int_upto): Fixnum#upto is merged.
* numeric.c (int_downto): Fixnum#downto is merged.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
singleton cbase.
* eval.c (is_defined): adopt new cvar behavior.
* eval.c (rb_eval): ditto.
* eval.c (assign): ditto.
* class.c (rb_mod_clone): should not call rb_obj_clone(), since
Module does not provide "allocate".
* class.c (rb_singleton_class): should crate new singleton class
if obj is a class or module and attached object is different,
which means metaclass of singleton class is sought.
* time.c (time_s_alloc): now follows allocation framework.
* eval.c (rb_eval): should initialize outer class variables from
methods in singleton class definitions.
* eval.c (assign): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
only, no methods.
* eval.c (is_defined): should not dump core on defined?(a::b)
where a is not a class nor a module.
* object.c (Init_Object): remove dup and clone from TrueClass,
FalseClass, and NilClass.
* array.c (rb_ary_fill): Array#fill takes block to get the value to
fill.
* string.c (rb_str_to_i): to_i(0) auto-detects base radix.
* array.c (rb_ary_initialize): fill by the block evaluation value
if block is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_thread_cleanup): need not to free thread stacks at
process termination.
* array.c (rb_ary_fetch): use the block to get the default value
if the block is given.
* eval.c (rb_thread_schedule): should check time only if BOTH
WAIT_SELECT and WAIT_TIME.
* eval.c (umethod_bind): should update rklass field.
* hash.c (rb_hash_update): if a block is given, yields [key,
value1, value2] to the block to resolve conflict.
* string.c (rb_str_split_m): no need to consider KANJI
characters, if the length of separator is 1 (byte).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_mod_initialize): should accept zero argument.
* object.c (rb_mod_cmp): should raise ArgumentError if
inheritance/inclusion relation between two classes/modules is
not defined. [new]
* io.c (rb_io_fsync): new method. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
NODE_SCLASS.
* gc.c (obj_free): need not to clear method cache on class/module
finalization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_hash_set_default): Hash#default= should return the
new value.
* string.c (rb_str_to_i): accepts optional base argument. [new]
* numeric.c (rb_fix2str): should not handle negative fixnum values
int32 via calling sprintf() directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
div, mod.
* time.c (time_cmp): should handle Bignums.
* array.c (rb_ary_pop): should ELTS_SHARED flag check before
REALLOC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
modifying buffer is shared.
* array.c (ary_make_shared): make an internal buffer of an array
to be shared.
* array.c (rb_ary_shift): avoid sliding an internal buffer by
using shared buffer.
* array.c (rb_ary_subseq): avoid copying the buffer.
* parse.y (gettable): should freeze __LINE__ string.
* io.c (rb_io_puts): old behavoir restored. rationale: a) if you
want to call to_s for arrays, you can just call print a, "\n".
b) to_s wastes memory if array (and sum of its contents) is
huge. c) now any object that has to_ary is treated as an array,
using rb_check_convert_type().
* hash.c (rb_hash_initialize): now accepts a block to calculate
the default value. [new]
* hash.c (rb_hash_aref): call "default" method to get the value
corrensponding to the non existing key.
* hash.c (rb_hash_default): get the default value based on the
block given to 'new'. Now it takes an optinal "key" argument.
"default" became the method to get the value for non existing
key. Users may override "default" method to change the hash
behavior.
* hash.c (rb_hash_set_default): clear the flag if a block is given
to 'new'
* object.c (Init_Object): undef Data.allocate, left Data.new.
* ext/curses/curses.c (window_scrollok): use RTEST().
* ext/curses/curses.c (window_idlok): ditto.
* ext/curses/curses.c (window_keypad): ditto.
* ext/curses/curses.c (window_idlok): idlok() may return void on
some platforms; so don't use return value.
* ext/curses/curses.c (window_scrollok): ditto for consistency.
* ext/curses/curses.c: replace FIX2INT() by typechecking NUM2INT().
* parse.y (str_extend): should not process immature #$x and
#@x interpolation, e.g #@#@ etc.
* enum.c (enum_sort_by): sort_by does not have to be stable always.
* enum.c (enum_sort_by): call qsort directly to gain performance.
* util.c (ruby_qsort): ruby_qsort(qs6) is now native thread safe.
* error.c (rb_sys_fail): it must be a bug if it's called when
errno == 0.
* regex.c (WC2MBC1ST): should not pass through > 0x80 number in UTF-8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_mark_all): tweak mark order for little bit better scan.
* gc.c (rb_gc_mark): ditto.
* gc.c (rb_gc): ditto.
* enum.c (sort_by_i): slight performance boost.
* gc.c (gc_mark_rest): should call gc_mark_children(), not gc_mark().
* gc.c (rb_gc_mark): may cause infinite looop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on Guy Decoux's patch in [ruby-talk:25478].
* string.c (rb_str_succ): there was buffer overrun.
* parse.y (str_extend): term can be any character.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
expression interpolation.
* pack.c (pack_unpack): should give length to utf8_to_uv().
* pack.c (utf8_to_uv): add length check.
* massages: replace "wrong #" by "wrong number".
* marshal.c (w_float): output Infinity and NaN explicitly.
* marshal.c (r_object): support new explicit float format.
* eval.c (rb_thread_wait_for): select may cause ERESTART on
Solaris.
* eval.c (rb_thread_select): ditto.
* array.c (rb_ary_join): dumped core if sep is not T_STRING nor T_NIL.
* array.c (rb_ary_join): buffer size calculattion was wrong.
* array.c (rb_ary_to_s): if rb_output_fs is nil, insert newlines
between array elements (use rb_default_rs as newline litral)
[experimental].
* gc.c (init_mark_stack): no need to clear mark_stack.
* gc.c (gc_mark_all): need to handle finalizer mark.
* gc.c (gc_mark_rest): use MEMCPY instead of memcpy.
* gc.c (rb_gc_mark): earlier const check to avoid pusing special
constants into mark stack.
* numeric.c (fix_to_s): 'to_s' now takes optional argument to
specify radix. [new]
* bignum.c (rb_big_to_s): ditto. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
POSIX_SIGNAL is defined.
* eval.c (error_print): errat array may be empty.
* eval.c (rb_eval_cmd): should not upgrade safe level unless
explicitly specified by argument newly added.
* signal.c (sig_trap): should not allow tainted trap closure.
* variable.c (rb_f_trace_var): should not allow trace_var on safe
level higher than 3.
* variable.c (rb_f_trace_var): should not allow tainted trace
closure.
* gc.c: do not use static stack until system stack overflows.
* eval.c (eval): should call Exception#exception instead of
calling rb_exc_new3() directly.
* error.c (exc_exception): set "mesg" directly to the clone. it
might be better to set mesg via some method for flexibility.
* variable.c (cvar_override_check): should print original module
name, if 'a' is T_ICLASS.
* parse.y (yylex): float '1_.0' should not be allowed.
* variable.c (var_getter): should care about var as Qfalse
(ruby-bugs#PR199).
* array.c (cmpint): <=> or block for {min,max} may return bignum.
* array.c (sort_1): use rb_compint.
* array.c (sort_2): ditto.
* enum.c (min_ii): ditto.
* enum.c (min_ii): ditto.
* enum.c (max_i): ditto.
* enum.c (max_ii): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c (rb_cvar_set): empty iv_tbl may cause infinite loop.
* variable.c (rb_cvar_get): ditto.
* variable.c (cvar_override_check): ditto.
* bignum.c (rb_big_eq): convert Bignum to Float, instead of
reverse.
* time.c (time_localtime): getting tm should not be prohibited for
frozen time objects.
* time.c (time_gmtime): ditto.
* version.c (Init_version): freeze RUBY_VERSION,
RUBY_RELEASE_DATE, and RUBY_PLATFORM.
* file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and
PATH_SEPARATOR.
* file.c (rb_stat_cmp): should check operand type before calling
get_stat().
* eval.c (rb_eval_cmd): should not invoke "call" with a block on
any occasion.
* numeric.c (fix_aref): idx may be a Bignum.
* numeric.c (num_remainder): a bug in Numeric#remainder.
* eval.c (rb_exec_end_proc): END might be called within END
block.
* class.c (rb_mod_clone): should not copy class name, since clone
should remain anonymous.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/socket/socket.c (unix_peeraddr): getpeername(2) may result
len = 0.
* string.c (rb_str_subpat_set): support function for new argument
pattern String#[re,offset] = val. [new]
* eval.c (POP_BLOCK): rb_gc_force_recycle() was called too much.
Should not be called if SCOPE_DONT_RECYCLE is set.
* string.c (rb_str_aref_m): new argument pattern
String#[re,offset]. [new]
* string.c (rb_str_substr): should return an instance of
receiver's class.
* string.c (rb_str_succ): ditto.
* array.c (rb_ary_subseq): ditto.
* array.c (rb_ary_initialize): Array.new([1,2,3]) => [1,2,3]. [new]
* string.c (rb_str_reverse): should return an instance of
receiver's class.
* string.c (rb_str_times): ditto.
* array.c (rb_ary_times): ditto
* string.c (str_gsub): ditto.
* string.c (rb_str_ljust): ditto.
* string.c (rb_str_rjust): ditto.
* string.c (rb_str_center): ditto.
* eval.c (eval): retrieves file, line information from binding.
* eval.c (intersect_fds): counts intersecting fds.
* eval.c (rb_thread_schedule): only fds requested by
each thread count as select_value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_f_require): should check static linked libraries
before raising exception.
* array.c (rb_ary_equal): check identiry equality first.
* string.c (rb_str_equal): ditto.
* struct.c (rb_struct_equal): ditto.
* numeric.c (Init_Numeric): undef Integer::new.
* eval.c (rb_eval): NODE_WHILE should update result for each
conditional evaluation.
* eval.c (rb_eval): NODE_UNTIL should return last evaluated value
(or value given to break).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (umethod_bind): recv can be an instance of descender of
oklass if oklass is a Module.
* hash.c (rb_hash_equal): check identiry equality first.
* file.c (group_member): should check real gid only.
* file.c (eaccess): do not cache euid, since effective euid may be
changed via Process.euid=().
* file.c (eaccess): return -1 unless every specified access mode
is permitted.
* eval.c (rb_eval): while/until returns the value which is given
to break.
* parse.y (value_expr): using while/until/class/def as an
expression is now gives a warning, not an error.
* range.c (range_eqq): should compare strings based on magical
increment (using String#upto), not dictionary order.
* enum.c (enum_sort_by): new method for Schewartzian transformed
stable sort.
* variable.c (mod_av_set): detect constant overriding for built-in
classes/modules.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_rstrip_bang): new method.
* string.c (rb_str_associate): should consider STR_ASSOC too.
* eval.c (rb_undefined): do not recurse if method_missing is
undefined.
* process.c (proc_waitpid): now all arguments are optional.
* process.c (Init_process): waitpid is now alias to wait.
* process.c (Init_process): waitpid2 is now alias to wait2.
* process.c (rb_waitpid): made public.
* ext/pty/pty.c (pty_getpty): avoid disturbing SIGCHLD using
thread and rb_waitpid.
* process.c (proc_getpgrp): now takes no argument on all
platforms.
* process.c (proc_setpgrp): ditto.
* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
Socket::pack_sockaddr_in(). [new]
* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
Socket::pack_sockaddr_un(). [new]
* ext/socket/socket.c (sock_s_pack_sockaddr_in): added
Socket::unpack_sockaddr_in(). [new]
* ext/socket/socket.c (sock_s_pack_sockaddr_un): added
Socket::unpack_sockaddr_un(). [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (dir_s_chdir): warn only when invoked from multiple
threads or block is not given.
* object.c (rb_convert_type): should use rb_rescue(), not rb_rescue2().
* range.c (range_init): ditto.
* object.c (rb_obj_dup): should free generic_ivar if original owns
them.
* string.c (rb_str_each_line): should propagate taint mark.
* ext/nkf/nkf.c (rb_nkf_kconv): ditto.
* eval.c (rb_f_require): revamp for simpler implementation.
* file.c (rb_find_file_noext): use String object, instead of
passing char* around.
* file.c (rb_find_file): ditto.
* dln.c (dln_load): should use NSLINKMODULE_OPTION_BINDNOW.
* ruby.c (load_file): local variables 'c' remain uninitialized on
xflag.
* regex.c (re_match): prefetched escaped character too early.
* eval.c (rb_call0): add argument check for attr_readers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
creating brand new exception object of the receiver.
* eval.c (rb_eval_string_wrap): extend new ruby_top_self, not
original self.
* eval.c (rb_eval_cmd): respect ruby_wrapper if set.
* eval.c (eval): do not update ruby_class unless scope is not
provided.
* eval.c (eval): preserve wrapper information.
* eval.c (proc_invoke): ditto.
* eval.c (block_pass): ditto.
* parse.y (void_expr): too much warnings for void context
(e.g. foo[1] that can be mere Proc call).
* error.c (rb_name_error): new function to raise NameError with
name attribute set.
* eval.c (rb_f_missing): set name and args in the exception
object. [new]
* error.c (name_name): NameError#name - new method.
* error.c (nometh_args): NoMethodError#args - new method.
* lex.c (rb_reserved_word): lex_state after tRESCUE should be
EXPR_MID.
* gc.c (add_heap): allocation size of the heap unit is doubled for
each allocation.
* dir.c (isdelim): space, tab, and newline are no longer
delimiters for glob patterns.
* eval.c (svalue_to_avalue): new conversion scheme between single
value and array values.
* eval.c (avalue_to_svalue): ditto.
* eval.c (rb_eval): REXPAND now uses avalue_to_svalue(), return
and yield too.
* eval.c (rb_yield_0): use avalue_to_svalue().
* eval.c (proc_invoke): Proc#call gives avaules, whereas
Proc#yield gives mvalues.
* eval.c (bmcall): convert given value (svalue) to avalue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
time. previous behavior (search ".rb", then ".so") has a
security risk (ruby-bugs#PR140).
* array.c (rb_ary_to_ary): new function to replace internal
rb_Array(), which never calls to_a, but to_ary (rb_Array() might
call both). [new]
* regex.c (PUSH_FAILURE_POINT): push option status again.
* regex.c (re_compile_pattern): avoid pushing unnecessary
option_set.
* eval.c (rb_load): tainted string is OK if wrapped *and*
$SAFE >= 4.
* eval.c (rb_thread_start_0): should not nail down higher blocks
before preserving original context (i.e. should not alter
original context).
* eval.c (proc_yield): new method equivalent to Proc#call but no
check for number of arguments. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_or): ditto.
* eval.c (rb_thread_schedule): should save context before raising
deadlock, saved context for current thread might be obsolete.
* time.c (make_time_t): non DST timezone shift supported (hopefully).
* time.c (make_time_t): strict range detection for negative time_t.
* signal.c: SIGINFO added.
* eval.c (rb_ensure): should not SEGV when prot_tag is NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dbm/extconf.rb: allow specifying dbm-type explicitly.
* ext/dbm/extconf.rb: avoid gdbm if possible, because it leaks
memory, whereas gdbm.so doesn't. potential incompatibility.
* string.c (rb_str_insert): new method.
* parse.y (yylex): lex_state after RESCUE_MOD should be EXPR_BEG.
* array.c (rb_ary_insert): new method.
* array.c (rb_ary_update): new utility function.
* io.c (set_outfile): should check if closed before assignment.
* eval.c (rb_eval): should preserve value of ruby_errinfo.
* eval.c (rb_thread_schedule): infinite sleep should not cause
dead lock.
* array.c (rb_ary_flatten_bang): proper recursive detection.
* eval.c (yield_under): need not to prohibit at safe level 4.
* pack.c (pack_pack): p/P packs nil into NULL.
* pack.c (pack_unpack): p/P unpacks NULL into nil.
* pack.c (pack_pack): size check for P template.
* ruby.c (set_arg0): wrong predicate when new $0 value is bigger
than original space.
* gc.c (id2ref): should use NUM2ULONG()
* object.c (rb_mod_const_get): check whether name is a class
variable name.
* object.c (rb_mod_const_set): ditto.
* object.c (rb_mod_const_defined): ditto.
* marshal.c (w_float): precision changed to "%.16g"
* eval.c (rb_call0): wrong retry behavior.
* numeric.c (fix_aref): a bug on long>int architecture.
* eval.c (rb_eval_string_wrap): should restore ruby_wrapper.
* regex.c (re_compile_pattern): char class at either edge of range
should be invalid.
* eval.c (handle_rescue): use === to compare exception match.
* error.c (syserr_eqq): comparison between SytemCallErrors should
based on their error numbers.
* eval.c (safe_getter): should use INT2NUM().
* bignum.c (rb_big2long): 2**31 cannot fit in 31 bit long.
* regex.c (calculate_must_string): wrong length calculation.
* eval.c (rb_thread_start_0): fixed memory leak.
* parse.y (none): should clear cmdarg_stack too.
* io.c (rb_fopen): use setvbuf() to avoid recursive malloc() on
some platforms.
* file.c (rb_stat_dev): device functions should honor stat field
types (except long long such as dev_t).
* eval.c (rb_mod_nesting): should not push nil for nesting array.
* eval.c (rb_mod_s_constants): should not search array by
rb_mod_const_at() for nil (happens for singleton class).
* class.c (rb_singleton_class_attached): should modify iv_tbl by
itself, no longer use rb_iv_set() to avoid freeze check error.
* variable.c (rb_const_get): error message "uninitialized constant
Foo at Bar::Baz" instead of "uninitialized constantBar::Baz::Foo".
* eval.c (rb_mod_included): new hook called from rb_mod_include().
* io.c (opt_i_set): should strdup() inplace_edit string.
* eval.c (exec_under): need to push cref too.
* eval.c (rb_f_missing): raise NameError for "undefined local
variable or method".
* error.c (Init_Exception): new exception NoMethodError.
NameError moved under ScriptError again.
* eval.c (rb_f_missing): use NoMethodError instead of NameError.
* file.c (Init_File): should redifine "new" class method.
* eval.c (PUSH_CREF): sharing cref node was problematic. maintain
runtime cref list instead.
* eval.c (rb_eval): copy defn node before registering.
* eval.c (rb_load): clear ruby_cref before loading.
* variable.c (rb_const_get): no recursion to show full class path
for modules.
* eval.c (rb_set_safe_level): should set safe level in curr_thread
as well.
* eval.c (safe_setter): ditto.
* object.c (rb_obj_is_instance_of): nil belongs to false, not true.
* time.c (make_time_t): proper (I hope) daylight saving time
handling for both US and Europe. I HATE DST!
* eval.c (rb_thread_wait_for): non blocked signal interrupt should
stop the interval.
* eval.c (proc_eq): class check aded.
* eval.c (proc_eq): typo fixed ("return" was ommitted).
* error.c (Init_Exception): move NameError under StandardError.
* class.c (rb_mod_clone): should copy method bodies too.
* bignum.c (bigdivrem): should trim trailing zero bdigits of
remainder, even if dd == 0.
* file.c (check3rdbyte): safe string check moved here.
* time.c (make_time_t): remove HAVE_TM_ZONE code since it
sometimes reports wrong time.
* time.c (make_time_t): remove unnecessary range check for
platforms where negative time_t is available.
* process.c (proc_waitall): should push Process::Status instead of
Finuxm status.
* process.c (waitall_each): should add all entries in pid_tbl.
these changes are inspired by Koji Arai. Thanks.
* process.c (proc_wait): should not iterate if pid_tbl is 0.
* process.c (proc_waitall): ditto.
* numeric.c (flodivmod): a bug in no fmod case.
* process.c (pst_wifsignaled): should apply WIFSIGNALED for status
(int), not st (VALUE).
* io.c (Init_IO): value of $/ and $\ are no longer restricted to
strings. type checks are done on demand.
* class.c (rb_include_module): module inclusion should be check
taints.
* ruby.h (STR2CSTR): replace to StringType() and StringTypePtr().
* ruby.h (rb_str2cstr): ditto.
* eval.c (rb_load): should not copy topleve local variables. It
cause variable/method ambiguity. Thanks to L. Peter Deutsch.
* class.c (rb_include_module): freeze check at first.
* eval.c (rb_attr): sprintf() and rb_intern() moved into
conditional body.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (cond0): no special treatment of string literal in
condition.
* math.c: add acos, asin, atan, conh, sinh, tanh and hypot to Math.
* configure.in: check hypot availablility.
* missing/hypot.c: public domain rewrite of hypot.
* parse.y (warn_unless_e_option): warning condition was wrong.
* parse.y (warning_unless_e_option): ditto.
* enum.c (enum_all): new method 'all?', which returns true if
block returns true for all elements.
* enum.c (enum_any): new method 'any?', which returns true if
block retruns true for any of elements.
* marshal.c (marshal_load): do not give warning unless explicitly
set to verbose.
* eval.c (rb_exit): give string value "exit" to SystemExit.
* ruby.c (proc_options): -v should not print version if
proc_options called via moreswitches().
* parse.y (stmt): while/until modifier must work for empty body.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
based on ruby_frame->iter altered by PUSH_ITER().
* eval.c (rb_thread_fd_close): should save current context before
raising exception.
* io.c (set_stdin): preserve original stdin.
* io.c (set_outfile): preserve original stdout/stderr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (sigpipe): sighandler which does nothing.
* signal.c (trap): set sigpipe function for SIGPIPE.
* signal.c (Init_signal): default SIGPIPE handler should be
sigpipe function.
* array.c (rb_ary_subseq): wrong boundary check.
* parse.y (cond0): integer literal in condition should not be
compared to lineno ($.).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and delimiters.
* dir.c (remove_backslases): remove backslashes from path before
calling stat(2).
* dir.c (dir_s_glob): call rb_yield directly (via push_pattern) if
block is given to the method.
* dir.c (push_pattern): do not call rb_ary_push; yield directly.
* eval.c (blk_copy_prev): reduced ALLOC_N too much.
* eval.c (frame_dup): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
less than 2.
* eval.c (POP_VARS): propagate DVAR_DONT_RECYCLE, if
SCOPE_DONT_RECYCLE of ruby_scope is set.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which included commits to RCS files with non-trunk default branches.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which included commits to RCS files with non-trunk default branches.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12 b2dd03c8-39d4-4d8f-98ff-823fe69b080e