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

515 Коммитов

Автор SHA1 Сообщение Дата
matz c791dc1345 * eval.c (POP_BLOCK): turn on BLOCK_LEFT flag when leaving block.
* eval.c (proc_invoke): unpack return/break destination when block
  is already left.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-13 10:31:33 +00:00
matz 09590a73fa * eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
flag before calling getcontext(2).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-11 18:18:40 +00:00
matz 0933db5a90 * eval.c (rb_thread_restore_context): typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-11 17:58:25 +00:00
matz 466c684881 * eval.c (struct thread): add member to save backing store on
IA64. (ruby-bugs PR1086)

* eval.c (thread_mark): mark IA64 backing store region.

* eval.c (thread_free): free saved IA64 backing store.

* eval.c (rb_thread_save_context): save IA64 backing store as well.

* eval.c (rb_thread_restore_context): restore IA64 backing store.

* eval.c (THREAD_ALLOC): initialize IA64 members.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-11 17:52:24 +00:00
matz 5256bca931 * eval.c (rb_call_super): do not use rb_block_given_p() for
check. [ruby-talk:78656]

* eval.c (BEGIN_CALLARGS): push ITER_NOT only when ITER_PRE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-11 08:35:54 +00:00
matz 3d621a4c3d * eval.c (rb_f_at_exit): should not be called without a block.
block_given check added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-07 04:09:56 +00:00
matz 697af8e54c * eval.c (rb_call0): forgot to pop ruby_class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-06 21:54:46 +00:00
matz b51416e21f * eval.c (rb_call0): update ruby_class as well as ruby_cref.
(ruby-bugs-ja PR#540)

* eval.c (rb_yield_0): remove ruby_frame->cbase and unify to
  ruby_cref.  [ruby-talk:78141]

* eval.c: initialize /* OK */ variables by Qnil to stop warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-06 21:50:06 +00:00
nobu 1ea78bb8ff * eval.c (rb_load): should preserve current source file/line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-05 06:47:37 +00:00
matz 4aaa5493f9 * eval.c (method_proc): should specify YIELD_FUNC_SVALUE.
[ruby-dev:21107]

* marshal.c (w_object): should not call w_extended for USRMARSHAL
  dump. [ruby-dev:21106]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-04 05:28:50 +00:00
nobu 096f7a4c89 * eval.c (rb_call_super): should propagate previous block for
super call.  [ruby-talk:77884]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-03 14:56:54 +00:00
nobu 685082d06f * eval.c (call_trace_func): clear exception flag temporarily.
[ruby-dev:21090]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-03 10:25:32 +00:00
matz 2e9ba7e77b * eval.c (rb_yield_0): code clean up according to Nobu's patch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 20:19:40 +00:00
matz cdacb127fc * class.c (rb_obj_singleton_methods): should not go up to
ancestors unless the recursive flag is set. [ruby-list:38007]

* hash.c (env_each_key): use env_keys to avoid environment modify
  on the fly.

* hash.c (env_each_value): use env_values for safety.

* hash.c (env_each): allocate environment array first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 20:16:53 +00:00
nobu fd5bdcd21c * eval.c (rb_call_super): propagate previous block if a block is
given.  [ruby-talk:77577]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 04:45:19 +00:00
matz aa9ffb6c80 backoff eval.c 1.498
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-01 03:12:39 +00:00
matz 601354bd6b * eval.c (BEGIN_CALLARGS): should not always reset ruby_iter,
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
2003-08-01 02:52:21 +00:00
matz dea1baa169 * ext/stringio/stringio.c (strio_gets): only "gets" should set $_.
* ext/stringio/stringio.c (strio_getline): should not set $_ here.

* io.c (argf_to_s): argf.to_s returns "ARGF".

* io.c (set_defout_var, set_deferr_var): make $defout and $deferr
  obsolete.

* io.c (set_input_var, set_output_var): allow $stdin, $stdout,
  $stderr not to be instance of IO.

* io.c (rb_f_readline): forward method to current_file. gets,
  readline, readlines, getc, readchar, tell, seek, pos=, rewind,
  fileno, to_io, eof, each_line, each_byte, binmode, and closed?
  as well.

* io.c (argf_forward): utility function to forward method to
  current_file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-28 07:31:52 +00:00
matz 34ca2ab058 * variable.c (rb_mod_const_missing): "const_missing" should not
appear in the caller(); add call frame adjustment.

* eval.c (rb_method_missing): simplify call frame adjustment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-26 02:26:08 +00:00
matz 85911c410a * ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946]

* Minor cleanups.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-25 05:36:55 +00:00
matz 5dd2b7102c * gcc -Wall clean-up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 18:33:50 +00:00
nobu 7896128822 * configure.in (AC_C_VOLATILE): check if volatile works.
* defines.h (volatile): removed.

* eval.c (rb_thread_group): Thread#group.  [new]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 07:05:28 +00:00
matz e02b469de1 * eval.c (thgroup_add): no warning for terminated threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-24 05:18:47 +00:00
matz 0d1df1cd7d * variable.c (rb_mod_const_missing): new method. [ruby-core:00441]
* variable.c (rb_const_get_at): allow "const_missing" hook.

* variable.c (rb_const_get_0): ditto.

* eval.c (method_missing): rename from rb_undefined to clarify.

* eval.c (ruby_finalize_0): update exit status if any of END proc
  raises SystemExit. [ruby-core:01256]

* eval.c (rb_exec_end_proc): reduce rb_protect().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-22 08:42:47 +00:00
matz d675dbc279 * lib/xmlrpc: import.
* eval.c (thgroup_add): should return group for terminated thread
  case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-19 10:05:54 +00:00
matz 5b7d908752 * eval.c (thgroup_add): typo again. sorry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-19 03:23:05 +00:00
matz 91d6fe9a02 * eval.c (thgroup_add): typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-19 03:19:36 +00:00
matz adec8b726c * eval.c (thgroup_add): do not raise ThreadError on terminated
thread addition for compatibility.  just warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-19 03:18:44 +00:00
nobu d087821480 * eval.c (rb_attr): extra calls of method_added. [ruby-talk:76361]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-18 17:00:43 +00:00
matz 909c2274f9 * eval.c (rb_f_missing): VCALL is called only for LOCAL_ID. no
check required.

* parse.y (primary): pritmary:tFID generates NODE_FCALL.
  [ruby-dev:20641]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-18 05:29:46 +00:00
matz 8cee72d5c6 * eval.c (rb_clear_cache_by_class): check both klass and origin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-17 08:58:16 +00:00
matz 46bf621737 * eval.c (ruby_init): set ruby_running to true after
initialization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-17 05:23:54 +00:00
matz 0eb5a42b91 * eval.c (rb_proc_new): call svalue_to_avalue for yield argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-16 09:23:33 +00:00
matz 7406260aed * eval.c (rb_disable_super, rb_enable_super): deprecate.
* eval.c (thgroup_s_alloc): re-implement group struct.

* eval.c (thgroup_add): add check for enclose and frozen status.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-16 07:11:30 +00:00
nobu 0caa77e7bc * eval.c (rb_add_method, rb_alias): need to clear cache by
ID when method defined in parent class is cached for
  grand child classes.  [ruby-dev:20672]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-15 10:50:54 +00:00
nobu 30399f6c75 *** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-11 19:23:13 +00:00
nobu b2ffc1fcab * eval.c (avalue_to_svalue): typo.
* eval.c (rb_load): rb_prohibit_interrupt should not underflow.

* parse.y (NODE_STRTERM, tokadd_string, parse_string): moved string
  nest level from a static variable to NODE_STRTERM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-11 16:22:01 +00:00
eban d65dab3dfb * eval.c (rb_thread_schedule): parse error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-10 03:08:08 +00:00
matz 662e3cf1f9 * eval.c (rb_load): put rb_load_file() in a thread critical
section. [ruby-dev:20490]

* eval.c (compile): put rb_compile_string() in a thread critical
  section.

* variable.c (rb_const_get_0): should not warn if constant is not
  defined. (ruby-bugs-ja PR#509)

* bignum.c (rb_big2dbl): give a warning on overflow.
  (ruby-bugs-ja PR#510)

* util.c (ruby_strtod): change MDMAXEXPT from 511 to 308.

* pack.c (utf8_to_uv): long is sufficient.  LONG_LONG is not
  required.

* bignum.c (rb_big2str): support 32 bit (without `long long' type)
  machines. (ruby-bugs-ja PR#512)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-09 22:28:42 +00:00
matz 3de67ca69d * eval.c (rb_call_super): k->super maybe NULL if klass is Kernel.
[ruby-dev:20519]

* gc.c (obj_free): clear method cache when freeing class/module.

* eval.c (rb_mod_remove_method): allow "remove_method" to accept
  multiple arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-07 08:28:19 +00:00
matz 9ae79bfcb9 * node.h (NEW_NODE): cast arguments to rb_node_newnode().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-04 15:30:35 +00:00
matz 9d22a06ea0 * array.c (rb_values_at): extract common procedure from
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
2003-07-03 11:02:53 +00:00
matz 447578a8a0 * string.c (rb_str_shared_replace): clear flags before copy.
* string.c (rb_str_replace): ditto.

* eval.c (rb_yield_0): override visibility mode for module_eval
  etc. (ruby-bugs-ja PR#505)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-02 04:27:29 +00:00
nobu 6e85f9c99c * eval.c (mnew): ignore metaclasses have no influence, for rklass.
[ruby-talk:74706]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-30 08:53:10 +00:00
nobu e5a9dcb9d8 * configure.in (rb_cv_stack_grow_dir): check stack growing direction.
* eval.c (rb_thread_restore_context): prior configuration macro.

* gc.c (ruby_stack_length): always return the address of lower edge.

* gc.c (rb_gc_mark_locations): remove margin.  [ruby-dev:20462]

* gc.c (rb_gc, Init_stack): prior configuration macro.

* gc.c (Init_stack): add safety margin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-28 03:29:00 +00:00
nobu 5f80d051a6 * eval.c (rb_yield_0): show yielded block position not only yielding
point.  [ruby-dev:20441]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-24 08:59:34 +00:00
nobu 69459d98ef * dir.c (find_dirsep): get rid of warnings.
* eval.c (error_print): temporary value might be disposed by GC.

* hash.c (env_has_value, env_index): should not increment NULL.

* io.c (io_read, rb_io_sysread): not read when length is 0.

* io.c (rb_io_reopen): ensure initialized IO.

* io.c (rb_io_init_copy): sychronize file pointer.

* io.c (rb_io_s_pipe): make exception proof.

* string.c (rb_str_rindex_m): Fixnum 0 matched end of string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23 08:41:07 +00:00
matz 67dcad92b7 * string.c (rb_str_upto): generate sequence according to "succ"
order.  formerly check was done by dictionary order.
  [ruby-talk:74138]

* string.c (rb_string_value): fill constant empty string along
  with setting ELTS_SHARED if str->ptr is NULL. [ruby-core:01179]

* string.c (rb_string_value_ptr): ditto.

* string.c (rb_check_string_type): ditto.

* string.c (str_gsub): move END(0) check before mbclen2().

* string.c (scan_once): reduce END(0) check.

* io.c (rb_io_initialize): accept fixnum mode.

* eval.c (error_print): replace strchr() by memchr(), einfo may
  contain "\0".

* pack.c (pack_unpack): range check for "@" move; initialize check
  for "m".

* error.c (syserr_initialize): avoid buffer overflow.

* file.c (rb_file_s_readlink): expand buffer until readlink
  succeed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-23 06:52:39 +00:00
matz 25e0ff2e4b * eval.c (proc_invoke): forgot "break";
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-21 17:15:53 +00:00
matz 47b57348e6 * eval.c (proc_invoke): should not propagate distination tag if
tag is already handled in this level. (ruby-bugs-ja PR#501)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-06-21 15:36:06 +00:00