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

537 Коммитов

Автор SHA1 Сообщение Дата
matz ea2e8d3592 * eval.c (localjump_destination): should not raise ThreadError
exception for "break". [ruby-dev:21348]

* eval.c (proc_invoke): use result instead of prot_tag->retval.
  retval is no longer propagated to the ancestors.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-17 14:45:25 +00:00
nobu ecf0c48d5a * intern.h (rb_disable_super, rb_enable_super): replace with dummy
expressions instead of prototypes.  the functions remain yet for
  binary compatibility.  [ruby-talk:81758]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-12 03:30:45 +00:00
matz fc8e62d0df * bignum.c (rb_big_and): convert argument using 'to_int'.
* bignum.c (rb_big_or): ditto.

* bignum.c (rb_big_xor): ditto.

* eval.c (rb_f_require): allow "require" on $SAFE>0, if feature
  name is not tainted.

* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::stream):
  Supports StringIO.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-12 03:16:31 +00:00
usa 3587c1c725 * eval.c (win32_get_exception_list): avoid VC7 warning.
[ruby-win32:577]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-10 13:43:27 +00:00
nobu 80edcf82a1 * eval.c (struct tag): dst should be VALUE.
* eval.c (localjump_destination): stop at the scope where the current
  block was created.  [ruby-dev:21353]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-09 01:39:58 +00:00
matz c492b9b085 * eval.c (mark_frame_adj): need to adjust argv pointer if using
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
2003-09-05 05:07:54 +00:00
nobu 645d4abf42 * eval.c (rb_eval): should not handle exceptions within rescue
argument.  [ruby-talk:80804]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-02 00:51:39 +00:00
nobu 6f8f0a86f5 * eval.c (rb_eval): make tail recursion in ELSE clause of
RESCUE a jump.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-01 09:34:30 +00:00
matz b6feeb2945 * parse.y (aref_args): forgot to call NEW_SPLAT(). reported by
Dave Butcher.

* eval.c (Init_Thread): protect thgroup_default.  suggested by Guy
  Decoux in [ruby-talk:80623]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-01 09:02:43 +00:00
nobu d9acb91ae3 * eval.c (rb_thread_switch): add RESTORE_EXIT; exit by another
thread termination.

* eval.c (rb_thread_start_0): should not error_print() within
  terminated thread, because $stderr used by it might be
  overriden now.  [ruby-dev:21280]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-01 07:59:18 +00:00
eban ea1dc90ae4 * eval.c (TAG_DST()): take no argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-31 13:47:48 +00:00
matz 84c506745a * eval.c (rb_iter_break): should not call TAG_JUMP directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-30 05:26:47 +00:00
matz 8e9fbbf6d6 * eval.c (struct BLOCK): remove BLOCKTAG, use scope instead.
* eval.c (POP_TAG): no longer propagate retval.  retval is now set
  directly by localjump_destination().

* eval.c (localjump_destination): new function to cast
  return/break local jump.

* eval.c (rb_yield_0): stop TAG_RETURN/TAG_BREAK escaping.

* variable.c (rb_autoload_load): call const_missing if autoloading
  constant is not defined to allow hook.

* eval.c (rb_eval): use rb_const_get_from() instead of
  rb_const_get_at().

* eval.c (is_defined): forgot to check NODE_COLON3.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-30 00:04:02 +00:00
matz 22b955d9bf * eval.c (rb_eval): *a = [1,2] now assigns [[1,2]] to a.
consistent with *a = [1], which set [[1]] to a.

* node.h: merge NODE_RESTARY to NODE_SPLAT.

* parse.y: rules simplified a bit by removing NODE_RESTARY.

* sample/test.rb: updated for new assignment behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-27 19:43:50 +00:00
matz 9942c6ed13 * file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for
apparent cases. [ruby-talk:79748]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-23 17:06:55 +00:00
nobu 0124af9063 * eval.c (rb_eval, rb_iterate, block_pass): reduce PUSH/POP_TAG and
EXEC_TAG() for retry.  [ruby-dev:21216]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-23 07:00:02 +00:00
matz 46e1454dea * eval.c (rb_yield_splat): should check if "values" is array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-23 04:05:42 +00:00
matz fc63eb3a77 * enum.c (each_with_index_i): typo.
* eval.c (rb_yield_splat): should call svalue_to_avalue() before
  calling rb_yield_0().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-22 17:43:57 +00:00
matz dc0f677ef8 eval.c: typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-22 08:13:36 +00:00
matz 7ff7bcbf9d * enum.c (inject_i): use rb_yield_values.
* enum.c (each_with_index_i): ditto.

* eval.c (rb_yield_splat): new function to call "yield *values".

* string.c (rb_str_scan): use rb_yield_splat().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-22 08:09:58 +00:00
nobu 5eafb6e10d * eval.c (block_pass): improve passing current block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-21 16:00:34 +00:00
matz f3d25fdd9c * gc.c (id2ref): recycle check should be done by klass == 0.
[ruby-core:01408]

* eval.c (Init_Thread): Continuation#[] added.  [ruby-talk:79028]

* parse.y (mlhs_node): should allow "::Foo" (colon3) as lhs.

* parse.y (lhs): ditto.

* parse.y (yylex): should return tCOLON3 right after kCLASS.
  [ruby-talk:78918]

* error.c (exc_initialize): was converting argument to string too
  eagerly.  Only check was needed. [ruby-talk:78958]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-14 17:20:14 +00:00
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