summaryrefslogtreecommitdiff
path: root/eval.c
AgeCommit message (Collapse)Author
2003-06-07* parse.y (value_expr0): class and module statements should not bematz
warned for "void value expression". [ruby-talk:72989] * gc.c (add_final): should determine type by respond_to? * gc.c (define_final): ditto. * io.c (rb_io_ctl): should not depend on respond_to? * range.c (range_step): rb_check_string_type(). * process.c (proc_setgroups): new functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06* eval.c (error_print): needs to be exception proof.nobu
* eval.c (error_handle, rb_longjmp): bails out when exception reentered. (ruby-bugs-ja:PR#487), [ruby-core:01119], [ruby-core:01122] * eval.c (Init_Proc): pre-allocates critical error objects. * parse.y (cmd_brace_block, do_block, brace_block): initialize block variables at the beginning of the block. [ruby-talk:72521] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06* gc.c (define_final): eliminate rb_f_lambda() call.matz
* class.c (rb_scan_args): ditto. * signal.c (sig_trap): ditto. * hash.c (rb_hash_initialize): ditto. * variable.c (rb_f_trace_var): ditto. * ext/dl/dl.c (rb_dl_callback): ditto. * ext/win32ole/win32ole.c (ev_on_event): ditto. * eval.c (ruby_cleanup): $SAFE is turned off in the finalization. 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@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-06* eval.c (ruby_cleanup): $SAFE is turned off in the finalization.matz
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
2003-06-05* math.c (math_erf,math_erfc): new function. [ruby-list:37753]matz
* eval.c (ruby_finalize): no longer need to turn off $DEBUG in the finalizer. (ruby-bugs-ja PR#473) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-03* eval.c (rb_call_super): should search superclass method based onmatz
orig_func, not last_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-03* eval.c (rb_call): typo.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-03* eval.c (rb_call_super): inheritance line adjustment moved frommatz
rb_call(). [ruby-core:01113] * eval.c (rb_eval): use rb_call_super() to follow DRY principle. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-02* array.c (push_values_at): Array#values_at should work withmatz
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
2003-05-30* io.c (rb_f_syscall): type dispatch should be based onmatz
rb_check_string_type(), not FIXNUM_P(), because values may be a bignum. [ruby-talk:72257] * eval.c (rb_call0): should pass the current klass value to block_invoke, which may be called via "super". [ruby-core:01077] * eval.c (block_invoke): now takes 4th argument "klass". * eval.c (block_alloc): should propagate BLOCK_PROC to ruby_block. * marshal.c (r_object0): should not use "yield" method, use "call" instead. (ruby-bugs-ja PR#476) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-30* eval.c (rb_Array): exclude Kernel#to_a instead of Object#to_a.nobu
(ruby-bugs-ja:PR#483) * lib/optparse.rb (OptionParser::Switch#parse_arg): not splat. * lib/optparse.rb (OptionParser::Switch#conv_arg): splat if no conversion supplied. * lib/optparse.rb (OptionParser::Switch::PlacedArgument#parse): override next switch after argument conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-29* eval.c (ev_const_defined, ev_const_get), variable.cnobu
(rb_const_get_at, rb_const_get, rb_mod_remove_const): use Qundef as autoload marker. [ruby-dev:18103], [ruby-dev:18184] * eval.c (rb_mod_autoload, rb_mod_autoload_p): new method; Module#autoload, Module#autoload?. * variable.c (rb_autoload, rb_autoload_load, rb_autoload_p): manage autoload constants per classes/modules. * variable.c (rb_const_defined_at, rb_const_defined): return false for autoloading constants. * class.c (rb_define_class, rb_define_module), eval.c (rb_eval), variable.c (rb_mod_const_at, rb_const_assign): removed autoload stuff. * intern.h: prototypes; rb_autoload, rb_autoload_load, rb_autoload_p. * lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse): do not treat unmatched argument as an option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-27* eval.c, util.c: removed duplicated includes/defines.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-26* eval.c (Init_Proc): Block/Proc separation. [huge change]matz
* eval.c (block_arity): returns exact arity number for Procs out of methods. also gives 1 for {|a|..}. * string.c (rb_str_match): revert use of String#index for invocation like string =~ string. * eval.c (rb_Array): move Object#to_a exclusion hack from splat_value(). need to be in eval.c for a while. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-23* eval.c (rb_longjmp): wrong jump.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-23* eval.c (rb_longjmp): get rid of reentering while debug warning.nobu
(ruby-bugs-ja:PR473) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-23* eval.c (ruby_finalize): turn off ruby_debug flag before callingmatz
at_exit procs and finalizers. (ruby-bugs-ja:PR473) * ext/tcltklib/tcltklib.c (lib_mainloop_core): OK to block if there's no other thread. (ruby-bugs:PR#861) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-22* eval.c (rb_define_alloc_func): need not to disablematz
rb_call_super() for allocation functions. [ruby-core:1065] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-21* eval.c (rb_eval): splat NODE_RESTARY. [ruby-dev:20268]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-21* eval.c (rb_thread_fd_close): raise for writing threads.nobu
[ruby-dev:20269] * io.c (rb_io_close, io_reopen): ditto. * io.c (io_reopen): keep stdio objects for stdin, stdout, and stderr. [ruby-dev:19442] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-21* error.c (syserr_initialize): prohibit specifying errno formatz
subclasses of SystemCallError. in addition, if initialize is called for SystenCallError instance, its class be changed. [ruby-dev:20257] * gc.c (run_final): to protect thread context switch, finalizers are wrapped in DEFER_INTS/ENABLE_INTS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-20* eval.c (rb_thread_save_context): prohibit rb_gc_force_recycle()matz
on thread saved ruby_dyna_vars. [ruby-dev:20236] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-20* eval.c (rb_yield_0): give warning for multiple values for amatz
block parameter. * eval.c (rb_yield_values): a function to yield multiple values. * array.c (sort_1): use rb_yield_values. * enum.c (min_ii, max_ii): ditto. * hash.c (rb_hash_update_block_i, delete_if_i, select_i, each_pair_i, env_each, env_reject_bang, env_select, env_update_i): ditto. * struct.c (rb_struct_each_pair): ditto. * eval.c (top_include): should include module in the current self, not ruby_top_self. [ruby-dev:20198] * eval.c (top_include): stop inclusion to ruby_wrapper; give warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-20* eval.c (rb_f_missing): create exception instance by ordinalnobu
method. * error.c (rb_name_error, rb_sys_fail): ditto. * error.c (exc_to_s, exit_status, name_err_name, nometh_err_args, syserr_errno, syserr_eqq): access attributes. * error.c (name_err_initialize, nometh_err_initialize, syserr_initialize): initialize attributes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-19* ext/pty/pty.c (pty_finalize_syswait): join (using Thread#value)matz
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
2003-05-19* object.c (init_copy): rename copy_object as initialize_copy,matz
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
2003-05-19* array.c (get_inspect_tbl): check whether inspect_tbl value is amatz
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
2003-05-16* eval.c (block_pass): chain previous block to the pushing block.matz
* time.c (time_cmp): does not compare with numbers for interchangeability. (ruby-bugs-ja PR#458) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-13* eval.c (error_pos): use $deferr for output instead of stderrmatz
directly. * eval.c (error_print,error_handle,rb_longjmp,rb_thread_schedule): ditto. * io.c (Init_IO): new variable $deferr which is default output port of error messages. * io.c (rb_warn_m): new method "warn". [new] * error.c (warn_print): use $deferr. * error.c (rb_bug): ditto. * error.c (err_append): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-02* string.c (rb_str_ljust): now takes optional argument to specifymatz
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
2003-04-25* eval.c (splat_value): split splat_value() and avalue_splat().matz
* io.c: there's no way to set non-IO value to current_file, thus no need for argf_forward(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-25* eval.c (proc_invoke): Proc#yield should pass through retry andmatz
break like keyword yield. [ruby-talk:70034] * eval.c (proc_invoke): orphan Proc now raises LocalJumpError for break and retry again. * eval.c (rb_eval): ARGSCAT should splat the argument. * eval.c (splat_value): splat operation function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-10* variable.c (rb_mod_name): always return empty string formatz
anonymous class/module. (ruby-bugs-ja PR#424) * config.sub: stop forcing addition of -gnu to -linux. * variable.c (classname): refactoring. * variable.c (rb_class_path): __tmp__classpath__ handling moved from classname(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09* eval.c (rb_obj_is_method): indefinite return value.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09* variable.c (rb_obj_remove_instance_variable): better message.matz
[ruby-talk:68987] * variable.c (rb_mod_remove_const): ditto. * object.c (rb_obj_ivar_get): ditto. * object.c (rb_obj_ivar_set): ditto. * parse.y (yylex): ditto. * eval.c (rb_mod_define_method): Allow UnboundMethod as parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-09* bignum.c (BIGZEROP): macro to determine if x is a bignum zero.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-08* eval.c (Init_Proc): make Method and UnboundMethod independent.matz
They are like instance and its class. [ruby-core:00941] * parse.y (yylex): disallow global variables like "$1ve". [ruby-core:00945] * marshal.c (marshal_dump): Marshal.dump(0, false) should cause an error. (ruby-bugs-ja PR#421) * regex.c (re_compile_pattern): warn if '-' is the edge of character range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-07* ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove structmatz
size check. getnameinfo(3) can handle. [ruby-dev:19967] * io.c (io_read): do not call rb_sys_fail() when required data length is zero. (ruby-bugs-ja PR#420) * eval.c (umethod_proc): should raise TypeError, instead of returning error causing Proc. Following the principle of "fail early". [ruby-core:00927] * pack.c (pack_pack): small but serious typo. * eval.c (backtrace): skip internal allocator frame. (ruby-bugs-ja PR#416) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-04* eval.c (assign): should prepare mrhs by svalue_to_mrhs().matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-03* eval.c (rb_f_missing): use "inspect" for T_OBJECT as well.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-29* eval.c (avalue_to_svalue): use rb_check_array_type() again.matz
Clarify how "to_ary" and "to_a" work. [ruby-talk:68155] * eval.c (svalue_to_avalue): ditto. * eval.c (svalue_to_mrhs): ditto. * eval.c (rb_eval): unary splat to use to_a, but we need a hack to exclude Object#to_a until it's removed. * object.c (rb_Array): check obj.respond_to?("to_a"). Currently all object respond_to "to_a", but Object#to_a will be removed. * range.c (Init_Range): undefine to_ary. * re.c (Init_Regexp): ditto. * regex.c (re_compile_pattern): do not warn if "-" is at the top or last of character class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-26* eval.c (avalue_splat): new function to do unary * (splat)matz
operator. * eval.c (avalue_to_svalue,svalue_to_avalue,svalue_to_mrhs): do not use implicit "to_ary" conversion. * ext/curses/curses.c (GetWINDOW,GetMOUSE): add taint check. * ext/curses/curses.c (curses_init_screen): ditto. * ext/curses/curses.c (window_initialize): ditto. * gc.c (os_each_obj): prohibit ObjectSpace#each_object in safe mode ($SAFE >= 4). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25* eval.c (rb_yield_0): call avalue_to_mrhs() to assign blockmatz
parameter |a|. [ruby-dev:19897] * ruby.c (ruby_set_argv): freeze argument strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-25* io.c (rb_io_initialize): should check rb_secure(4).matz
* dir.c (dir_s_getwd): should check rb_secure(4). * object.c (rb_obj_infect): function version of OBJ_INFECT(). * eval.c (rb_secure_update): new function to check object update. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-24security enhancement of dl library (need test).matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-21* regex.c (re_compile_pattern): give warning for unescaped squarematz
brackets and minus in character class. [ruby-dev:19868] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-21* eval.c (bmcall): missing type.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-20* eval.c (load_dyna): clear ruby_errinfo. (ruby-bugs-ja PR#409)matz
* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408) * io.c (io_read): ditto. * io.c (rb_io_sysread): ditto. * range.c: do not override min and max. * sprintf.c (remove_sign_bits): octal left most digit for negative numbers may be '3'. (ruby-bugs-ja PR#407) * sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is negative, using sign_bits(). * eval.c (avalue_to_mrhs): split argument passing and assignment conversion. * eval.c (svalue_to_mrhs): ditto. * eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be [[1,2]], not [1,2] to wrap-around. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-20* eval.c (bmcall): add volatile to avoid GC problem.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-10* eval.c (massign): remove unnecessary array unpacking; it shouldmatz
be handled before massign() by svalue_to_mrhs(). * eval.c (svalue_to_mrhs): '*a = v' value conversion to avalue (i.e. [1] => [[1]], [1,2] => [1,2]). * eval.c (rb_eval): use svalue_to_mrhs. * eval.c (rb_yield_0): ditto. * eval.c (proc_invoke): break from "Proc#yield" is legal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e