Commit graph

962 commits

Author SHA1 Message Date
nobu
bdaaae417a stack_extend
* eval.c (stack_extend): prevent ALLOCA_N, which reserves a memory
  space with for restoring machine stack stored in each threads, from
  optimization out.  backport r34278 from the trunk.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@36251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-29 12:19:39 +00:00
nobu
268b6ddd36 * eval.c (ruby_setjmp): need to save the stack after r2 (the Table
of Contents on ppc64) is saved onto the stack by getcontext().
  based on <https://bugzilla.redhat.com/show_bug.cgi?id=628715>.
  Bug#4411


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@32542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-14 07:53:05 +00:00
shyouhei
793f30e38f * eval.c (rb_thread_atfork): When a ruby process forks, its random
seed shall be reinitialized to prevent CVE-2003-0900 situation.
  This bug affects for 1.8 and earlier series, but not for 1.9.
  fixed [ruby-core:34944].

* io.c (pipe_open): ditto.

* random.c (rb_reset_random_seed): ditto.

* intern.h (rb_reset_random_seed): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@31655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-20 21:21:39 +00:00
nobu
f5cbe886b6 * eval.c (rb_add_threadswitch_hook): wrapper for unofficial APIs
in Mac OS X port.  the use of them is strongly discouraged.

	* eval.c (rb_remove_threadswitch_hook): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-23 18:00:46 +00:00
kosaki
968bac58e6 * io.c, eval.c, process.c: remove all condition of r26371.
now, all platform use the same way. [Bug #3278][ruby-core:30167]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-23 20:00:48 +00:00
nobu
3dea38333c * eval.c (search_required): expand home relative path first.
[ruby-core:29610]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 10:13:14 +00:00
knu
7d4c34b9c6 * eval.c (rb_eval): Use for() and make it a bit easier to read and
debug here.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-26 04:10:38 +00:00
knu
5c54c57521 * prelude.rb, Makefile.in, common.mk: Introduce prelude.rb.
* eval.c (rb_eval_prelude): New function exported only for use in
  preludes.

* configure.in: Define RUBY_EXEC_PREFIX and RUBY_LIB_PREFIX.

* ruby.c (proc_options, ruby_init_loadpath, ruby_prelude): Load
  prelude.

* compile_prelude.rb: Port the prelude compiler from trunk.

* miniprelude.c: Currently miniruby does not include prelude.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-25 19:11:51 +00:00
naruse
c50494d6bb * io.c, eval.c, process.c: add linux to r26371's condition.
patched by Motohiro KOSAKI [ruby-core:28151]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-18 04:52:27 +00:00
knu
453f94c2b2 * eval.c (rb_f_loop): Return an enumerator if no block is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-10 07:30:47 +00:00
nobu
f81cdb36ab * eval.c (rb_mod_define_method): return original block but not
bound block.  [ruby-core:26984]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-01 07:43:10 +00:00
nobu
4c97668455 * eval.c (proc_invoke): reverted r25975. [ruby-dev:39931]
[ruby-dev:40059]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-01 07:40:45 +00:00
nobu
c0497c5b43 * eval.c (thread_init): used only for setitimer or threaded.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-27 05:25:13 +00:00
naruse
f0caeb92e8 * io.c, eval.c, process.c: add __APPLE__ to r26371's condition.
patched by Wataru Kimura [ruby-dev:40145]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-27 05:11:17 +00:00
usa
031cab4d2f * eval.c (thread_timer, rb_thread_stop_timer): check the timing of
stopping timer.  patch from KOSAKI Motohiro <kosaki.motohiro _AT_
  jp.fujitsu.com>

* eval.c (rb_thread_start_timer): NetBSD5 seems to be hung when calling
  pthread_create() from pthread_atfork()'s parent handler.

* io.c (pipe_open): workaround for NetBSD5. stop timer thread before
  fork(), and start it if needed.

* process.c (rb_f_fork, rb_f_system): ditto.
  fixed [ruby-dev:40074]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-21 16:29:51 +00:00
knu
386c4b9d00 * eval.c (recursive_push): Taint internal hash to prevent
unexpected SecurityError; fixes #1864.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-10 18:07:50 +00:00
nobu
282a055612 * eval.c (rb_load): initialize orig_func. [ruby-core:27296]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-23 08:23:54 +00:00
nobu
394dbd9e8d * eval.c (proc_invoke): unbound block created by define_method
cannot call super.  [ruby-core:26984]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-02 08:32:52 +00:00
nobu
6ead29d044 * eval.c (rb_method_missing): adjusted format and argument number.
* eval.c (rb_call): fixed for super in cached method.
  [ruby-dev:39757]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-23 14:59:28 +00:00
marcandre
9c197735be * eval.c (method_inspect, method_name, mnew): Bug fix when
method created from an alias.
  Based on a patch by Peter Vanbroekhoven [ruby-core:22040]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-08 16:55:30 +00:00
nobu
3241664bc3 * eval.c (call_trace_func): remove the trace hook if any exception
raised.  [ruby-list:46515]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 02:01:36 +00:00
nobu
d10ef54c60 * eval.c (get_event_name): added thread events.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 01:56:23 +00:00
nobu
3f0d0b9398 * *.[chy]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22 01:00:18 +00:00
nobu
d2c1ab806d * eval.c (rb_clear_cache_for_undef): clear entries for inherited
methods.  [ruby-core:26074]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16 00:52:02 +00:00
usa
af3460ef8c * eval.c (rb_origenviron): remove unused old variable.
[ruby-dev:39412]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 04:55:06 +00:00
marcandre
5d3affad07 * eval.c (Kernel#autoload?): doc fix by Jeremy Henty [ruby-core:19983]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23 17:25:41 +00:00
marcandre
a4c105c337 * eval.c (umethod_bind): Fix bug that disallowed methods from singleton classes to be used for UnboundMethod#bind and Module#define_method, even when that singleton class was of the right kind_of [ruby-core:25632]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-22 20:37:20 +00:00
marcandre
7c63ba4efe * eval.c (rb_mod_define_method): Doc fix (accepts UnboundMethod too)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-22 18:56:29 +00:00
nobu
73b865bd41 * eval.c (rb_thread_start_0, rb_thread_start_1): should call start
timer after added new thread to thread list.  [ruby-core:25613]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-17 05:33:39 +00:00
nobu
ce897307b0 * eval.c (rb_thread_start_timer): start to catch SIGVTALRM together
with timer thread.   [ruby-core:25606]

* eval.c (rb_thread_atfork): stop timer thread.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-16 07:51:07 +00:00
shyouhei
1a884e8cd5 Merge branch '19migration/looser_args' into ruby_1_8
Conflicts:

	ChangeLog

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-28 16:06:58 +00:00
akr
a11988cd63 * eval.c (rb_thread_schedule): need select for WAIT_SELECT, even if
already timeout.  [ruby-dev:38971]
  (WAIT_DONE): defined for mark threads which can be runnable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-07 14:40:36 +00:00
akr
7d3391c1fb * eval.c (rb_thread_schedule): refine previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-06 00:07:13 +00:00
akr
eb2ce3dfa5 * eval.c (rb_thread_schedule): fix condition for making thread
runnable.  [ruby-core:23515]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 16:31:08 +00:00
nobu
699d9a15c4 * eval.c (rb_exc_raise, rb_exc_fatal): require exception object.
[ruby-core:24767]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 03:54:08 +00:00
nobu
4f5267ce12 * eval.c (rb_eval): does not restore old errinfo when fatal error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 03:46:54 +00:00
nobu
c41d275f6b * eval.c (rb_eval): not discard fatal error.
* eval.c (rb_longjmp): reset raised flag before fatal error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 03:36:46 +00:00
nobu
56057f9f8f * eval.c (rb_event_all, rb_add_event_hook): merged thread-switch
events for RubyCocoa.  [ruby-dev:38924]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-28 06:48:20 +00:00
nobu
1031c20714 * configure.in (DEPRECATED): backported from trunk.
* eval.c (rb_mod_autoload): should use SafeStringValue() instead
  obsolete Check_SafeStr().

* ruby.h (rb_check_safe_str, rb_str2cstr): deprecation warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 05:03:30 +00:00
nobu
b8d684d9e2 * eval.c (PUSH_ANCHOR, POP_ANCHOR, rb_thread_start_0): separated
anchors from PROT_THREAD.  [ruby-core:24097]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 06:49:17 +00:00
nobu
072ccff04d * eval.c (rb_thread_join), ext/thread/thread.c (wake_one): adjusts
targets of rest waiting threads to join.  [ruby-core:23457]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-15 08:33:52 +00:00
nobu
87d469b150 * eval.c, gc.c (_longjmp): never return. see [ruby-core:23241]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-01 04:12:40 +00:00
nobu
61c5c2e623 * eval.c (get_ts): use readtime clock. [ruby-dev:38354]
* eval.c (rb_thread_stop_timer): clear thread_init while locking.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-28 14:05:07 +00:00
nobu
c35cb918f6 * eval.c (rb_thread_start_timer): guard condition was inverted.
[ruby-dev:38319]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-24 05:55:16 +00:00
nobu
d09363d8c9 * eval.c (proc_invoke): shares dmethod scope local variables.
a patch from coderrr at [ruby-core:23050]

* gc.c (obj_free): do not free cloned scope local variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-22 03:20:14 +00:00
nobu
0d6f4f3668 * eval.c (ruby_cleanup): the order of local variables on stack is
undefined.  should use outermost VALUE for ruby_init_stack.

* gc.c (rb_stack_growup_p): returns stack grows up.

* gc.c (Init_stack, ruby_init_stack): allows volatile pointer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-19 05:31:58 +00:00
nobu
7a45568809 * eval.c (safe_mutex_lock): pthread_cleanup_push() must not be
inside parens.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-18 10:44:55 +00:00
nobu
9e59bd2d0f * eval.c (rb_thread_remove): stops timer thread unless other
threads exist.  [ruby-core:18444]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-18 09:25:55 +00:00
nobu
3175b6e7bb * gc.c (Init_stack): use ruby_init_stack. [ruby-dev:34350]
* intern.h (Init_stack): make to call ruby_init_stack.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-03 09:38:01 +00:00
nobu
92d6ce2e8d ------------------------------------------------------------------------
r15996 | nobu | 2008-04-14 12:52:27 +0900 (Mon, 14 Apr 2008) | 2 lines

* gc.c (Init_stack): use ruby_init_stack.  [ruby-dev:34350]

------------------------------------------------------------------------
------------------------------------------------------------------------
r17036 | nobu | 2008-06-09 09:54:23 +0900 (Mon, 09 Jun 2008) | 2 lines

* include/ruby/intern.h (Init_stack): make to call ruby_init_stack.

------------------------------------------------------------------------


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-03 04:52:48 +00:00