Commit graph

829 commits

Author SHA1 Message Date
nobu
d33cc535c3 * node.h (struct rb_thread.locals): explicit as struct.
[ruby-core:10585]

* eval.c, node.h (enum rb_thread_status, struct rb_thread,
  rb_curr_thread, rb_main_thread): prefixed.  [ruby-core:10586]

* file.c (chompdirsep): made an unprefixed name static.

* io.c (io_fread): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-24 14:40:08 +00:00
nobu
2898d5c5a8 * eval.c (ruby_cleanup): exit by SystemExit and SignalException in END
block.  [ruby-core:10609]

* test/ruby/test_beginendblock.rb (test_should_propagate_exit_code):
  test for exit in END block.  [ruby-core:10760]

* test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
  test for signal in END block.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-23 16:53:42 +00:00
nobu
a8ba0adb5c * eval.c (rb_provided): check for extension library if SOEXT is
explicitly given.  [ruby-dev:30657]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-22 14:12:56 +00:00
nobu
409be50fe1 * eval.c (error_handle): no message when exiting by signal.
* eval.c (ruby_cleanup): re-send signal.  [ruby-dev:30516]

* eval.c (rb_thread_interrupt): instantiate SignalException.

* eval.c (rb_thread_signal_raise): now takes signal number instead
  of signal name.

* intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes.

* signal.c (esignal_init): takes a signal number and an optional
  signal name.

* signal.c (interrupt_init): pass SIGINT always.

* signal.c (ruby_default_signal): invoke system default signal
  handler.

* signal.c (rb_signal_exec, trap): handle SIGTERM.  [ruby-dev:30505]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-11 03:09:30 +00:00
knu
44a1d06e1a * eval.c (stack_check): Unset inline to fix build with GCC 3.4.6;
submitted by: NISHIMATSU Takeshi <t_nissie AT yahoo.co.jp> in
  [ruby-list:43218].
  cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24556


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-03 12:40:29 +00:00
knu
deeafa0e17 * env.h (SCOPE_CLONE): Introduce a new scope flag to prevent a
local_tbl region from getting freed many times; submitted by
  Chikanaga Tomoyuki <chikanag AT nippon-control-system.co.jp> in
  [ruby-dev:30460].

* eval.c (proc_invoke): Ditto.

* gc.c (obj_free): Ditto.

* parse.y (top_local_setup_gen): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-03 07:28:54 +00:00
nobu
51f9355bd6 * eval.c (rb_feature_p): fix possible buffer overrun.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-28 23:55:34 +00:00
nobu
5093a9eff1 * eval.c (rb_feature_p): check loading_tbl if the given ext is
empty.  [ruby-dev:30452]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-28 23:53:02 +00:00
nobu
d8ecc168f1 * eval.c (rb_provided): return true only for features loaded from
.rb files, and not search actual library type.  [ruby-dev:30414]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-28 15:09:37 +00:00
knu
e7b39d9d4f * configure.in, defines.h, eval.c (rb_feature_p, rb_provided,
load_wait, search_required, rb_require_safe), ext/extmk.rb: Fix
  a bug where a statically linked extension cannot be autoloaded.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-19 09:27:12 +00:00
matz
ff46ec3a43 * eval.c (rb_iterate): need to PUSH_ITER in proper order.
[ruby-core:10125]

* test/ruby/test_iterator.rb (TestIterator::test_block_given_within_iterator):
  add new test.  [ruby-core:10125]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-31 05:59:23 +00:00
matz
e43d14725f * parse.y (dyna_var_lookup): should not alter dvar->val not to
destroy living value.  [ruby-core:10076]

* parse.y (dyna_init): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-27 14:25:02 +00:00
nobu
bb949fd267 * eval.c (ruby_cleanup): keep the exception till after END blocks.
[ruby-core:09675]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-09 12:40:17 +00:00
matz
61634cee5f * eval.c (rb_mod_define_method): set implicit visibility only when
it's called for the target class (ruby_cbase).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-24 01:23:50 +00:00
matz
3a77579adc * eval.c (BEGIN_CALLARGS): ruby_block may be NULL even when
ITER_PRE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-08 18:17:46 +00:00
usa
8c61368971 * eval.c (rb_call0): fixed bug of zsuper with both of opt and rest.
fixed: [ruby-list:42928]

* test/ruby/test_super.rb: add tests to check above bug.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-31 16:10:22 +00:00
matz
0d4f83264f * eval.c (rb_call): check protected visibility based on real self,
not ruby_frame->self.  [ruby-talk:217822]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-04 08:38:23 +00:00
why
41256fd432 * eval.c (rb_thread_save_context, rb_thread_restore_context):
sandbox hook to save and restore sandbox state.

* eval.c (thread_no_ensure): added THREAD_NO_ENSURE thread flag.

* eval.c (rb_thread_kill_bang): Thread#kill! uses the above flag
  to circumvent ensure, in order to prevent endless loops.
  [ruby-core:08768]

* eval.c (rb_thread_kill): fix Thread#kill docs, which returns
  the thread object in all cases.

* node.h: expose the rb_jmpbuf_t and rb_thread_t structs, along
  with the thread flags.  used by the sandbox extension.

* ruby.h: extern rb_eThreadError, so sandbox can swap it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-23 14:39:32 +00:00
nobu
3ba3860f58 * eval.c (rb_require_safe): prevent extension from loading twice.
fixed: [ruby-dev:29523]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-10 00:18:39 +00:00
nobu
28fd8a2d91 * eval.c (stack_extend): fixed prototype.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-10 00:09:11 +00:00
akr
53cec657a1 * common.mk, configure.in, defines.h, eval.c, gc.c, main.c,
numeric.c, ruby.h, ia64.s: backport IA64 HP-UX support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-01 18:47:11 +00:00
why
882ce706c1 * eval.c (ruby_init): rename top_cref to ruby_top_cref and export,
along with ruby_cref, for use by the sandbox. [ruby-core:08762]

* node.h: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 03:52:48 +00:00
matz
390aa97698 * dln.c, eval.c, gc.c, regex.c, ruby.h: shut up AIX alloca
warning.  [ruby-dev:29191]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-07 03:43:42 +00:00
nobu
a815a47235 * eval.c (Init_Binding): fix old commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-01 03:25:14 +00:00
matz
17c3d539f0 * ruby.h: use ifdef (or defined) for macro constants that may or
may not be defined to shut up gcc's -Wundef warnings.
  [ruby-core:08447]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31 06:34:10 +00:00
nobu
fe1608a519 * eval.c (rb_call0): trace call/return of method defined from block.
fixed: [ruby-core:08329]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-30 14:27:01 +00:00
nobu
ea899f6b18 * eval.c (rb_trap_eval): make the current thread runnable to deal with
exceptions which occurred within the trap.  fixed: [ruby-dev:27729]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-30 13:30:19 +00:00
nobu
8c217096f4 * eval.c (backtrace): skip frames successive on node and method name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-24 13:04:39 +00:00
matz
dfc502ad24 * eval.c (rb_call0): revert last change. [ruby-dev:29112]
[ruby-core:08374]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-24 06:25:21 +00:00
nobu
4d4f9e8146 * eval.c (rb_call0): include funcalled methods in caller list.
fixed: [ruby-core:08290]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-21 12:22:08 +00:00
matz
980326f6f1 * ruby.h: export classes/modules to implement sandbox.
[ruby-core:08283]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-20 07:04:17 +00:00
nobu
9b3e810057 * eval.c (rb_require_safe): wait for another thread requiring the same
feature.  fixed: [ruby-core:08229]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-15 14:50:49 +00:00
matz
b268c7309e * array.c (rb_ary_pop): may cause realloc oscillation. a patch
from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>.
  [ruby-dev:29028]

* parse.y (then): we'd like to reserve colon here for the future.
  warning added.

* ruby.h: export rb_cMethod.  [ruby-talk:201259]

* ext/bigdecimal/bigdecimal.c: Allows '_' to appear within
  digits.  [ruby-dev:28872]

* ext/bigdecimal/lib/bigdecimal/util.rb: Bug in to_r reported by
  [ruby-list:42533] fixed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-13 15:43:02 +00:00
nagai
5ed246f1d3 * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
sigsend_to_ruby_thread, install_nativethread_sighandler):
  nativethread-support on signal handler. RE-backport from 1.9.

* ruby.h (HAVE_NATIVETHREAD_KILL): ditto.

* eval.c (ruby_native_thread_kill): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 05:02:00 +00:00
nobu
010de8e28c * eval.c (rb_clear_cache_for_undef): clear entries for included
module.  fixed: [ruby-core:08180]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 00:30:40 +00:00
nobu
46c525ca9b * eval.c (next_jump): deal with destination of next.
fixed: [ruby-core:08169]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-08 15:55:37 +00:00
nobu
ef8e63acb5 * util.c (powersOf10): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 15:54:22 +00:00
nagai
e4def7400f * signal.c: revert last change.
* ruby.h: ditto.
* eval.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-23 21:37:10 +00:00
nagai
44e53b1dea * signal.c (ruby_nativethread_signal, posix_nativethread_signal,
sigsend_to_ruby_thread, install_nativethread_sighandler):
  nativethread-support on signal handler (backport from 1.9).

* ruby.h (HAVE_NATIVETHREAD_KILL): ditto.

* eval.c (ruby_native_thread_kill): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-21 08:37:35 +00:00
matz
d4e741e89e * eval.c (rb_call0): binding for the return event hook should have
consistent scope.  [ruby-core:07928]

* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
  event_hooks.	no guarantee for arbitrary hook deletion.
  [ruby-dev:28632]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-07 00:19:14 +00:00
matz
db3bdf6eca * eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-22 07:01:53 +00:00
matz
af89971287 * eval.c (ev_const_get): should support constant access from
within instance_eval().  [ruby-dev:28327]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-22 04:41:36 +00:00
matz
2835df5a05 * parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-04-19 04:57:58 +00:00
matz
1d3fd0024d * eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]

* parse.y (list_concat): revert last change.

* parse.y (arg): use NODE_ARGSCAT for placeholder.

* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
  mathew <meta at pobox.com>.  [ruby-core:07738]

* variable.c (rb_const_set): raise error when no target klass is
  supplied.  [ruby-dev:28582]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-04-19 03:02:03 +00:00
matz
e546c7dc2e * eval.c: block_unique should be 1, not frame_unique.
[ruby-dev:28577]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-04-17 15:13:07 +00:00
matz
861741d8a5 * eval.c (backtrace): reports aliased method names in a generated
backtrace.  a patch from "U.Nakamura" <usa at garbagecollect.jp>.
  [ruby-dev:28471]

* eval.c (rb_call0): insecure calling should be checked for non
  NODE_SCOPE method invocations too.

* eval.c (rb_alias): should preserve the current safe level as
  well as method definition.

* eval.c (yield_under_i): pass self again for instance_eval().
  [ruby-dev:28466]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-28 21:54:10 +00:00
matz
5b7cdcfb32 * eval.c (method_missing): should support argument splat in
super.  [ruby-talk:185438]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-23 01:52:05 +00:00
matz
6834f57ba0 * lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories.  a patch from Eric Hodel <drbrain at segment7.net>.
  [ruby-core:07423]

* eval.c (rb_thread_fd_writable): should not re-schedule output
  from KILLED thread (must be error printing).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-03 17:39:28 +00:00
ocean
c60fb7c72c * eval.c (SETUP_ARGS0): fixed memory corruption. [ruby-dev:28360]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-23 04:24:39 +00:00
matz
c519ca9500 * lib/rational.rb (Integer::gcd): replaced by gcd4 in
[ruby-core:07390].  [ruby-core:07377]

* eval.c: initial value for block_unique must be 1.
  [ruby-talk:180420]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 00:55:49 +00:00