summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--KNOWNBUGS.rb21
-rw-r--r--bootstraptest/test_proc.rb88
-rw-r--r--vm.c4
-rw-r--r--vm_insnhelper.c28
5 files changed, 125 insertions, 23 deletions
@@ -1,3 +1,10 @@
Wed Jun 18 01:51:10 2008 Hidetoshi NAGAI <[email protected]>
* ext/tk/lib/multi-tk.rb: cannot access class variable from
@@ -3,15 +3,18 @@
# So all tests will cause failure.
#
-assert_equal %q{[:bar, :foo]}, %q{
- def foo
- klass = Class.new do
- define_method(:bar) do
- return :bar
- end
end
- [klass.new.bar, :foo]
end
- foo
-}, "[ ruby-Bugs-19304 ]"
@@ -276,3 +276,91 @@ assert_equal 'ok', %q{
:ng
}.call
}, '[ruby-dev:34646]'
@@ -525,9 +525,9 @@ vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
if (state == TAG_RETURN && proc->is_lambda) {
VALUE err = th->errinfo;
VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = proc->block.dfp;
- if (escape_dfp == cdfp) {
state = 0;
th->errinfo = Qnil;
th->cfp = cfp;
@@ -1044,7 +1044,8 @@ vm_get_cvar_base(NODE *cref)
{
VALUE klass;
- while (cref && cref->nd_next && (NIL_P(cref->nd_clss) || FL_TEST(cref->nd_clss, FL_SINGLETON))) {
cref = cref->nd_next;
if (!cref->nd_next) {
@@ -1221,7 +1222,7 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
if (cfp->dfp == dfp) {
goto search_parent;
}
- cfp++;
}
rb_bug("VM (throw): can't find break base.");
}
@@ -1229,7 +1230,7 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_LAMBDA) {
/* lambda{... break ...} */
is_orphan = 0;
- pt = GET_LFP();
state = TAG_RETURN;
}
else {
@@ -1261,7 +1262,7 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
is_orphan = 0;
break;
}
- cfp++;
}
}
@@ -1284,26 +1285,29 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
* check orphan:
*/
while ((VALUE *) cfp < th->stack + th->stack_size) {
- if (GET_DFP() == dfp) {
if (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_LAMBDA) {
/* in lambda */
is_orphan = 0;
break;
}
}
- if (GET_LFP() == cfp->lfp &&
- cfp->iseq->type == ISEQ_TYPE_METHOD) {
- is_orphan = 0;
- break;
- }
- cfp++;
}
if (is_orphan) {
vm_localjump_error("unexpected return", throwobj, TAG_RETURN);
}
- pt = GET_LFP();
}
else {
rb_bug("isns(throw): unsupport throw type");