yarv-diff:251
From: ko1 atdot.net
Date: 14 Feb 2006 03:51:58 -0000
Subject: [yarv-diff:251] r414 - in trunk: . yarvtest
Author: ko1
Date: 2006-02-14 12:51:57 +0900 (Tue, 14 Feb 2006)
New Revision: 414
Modified:
trunk/
trunk/ChangeLog
trunk/eval.c
trunk/test.rb
trunk/vm.c
trunk/yarvtest/test_block.rb
Log:
r618@lermite: ko1 | 2006-02-14 12:51:05 +0900
* eval.c : fix rb_iterate hook
* yarvtest/test_block.rb : add a tests for above
* vm.c : remove unused comment
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:617
+ 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:618
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-02-14 03:51:35 UTC (rev 413)
+++ trunk/ChangeLog 2006-02-14 03:51:57 UTC (rev 414)
@@ -4,6 +4,15 @@
# from Mon, 03 May 2004 01:24:19 +0900
#
+2006-02-14(Tue) 12:42:59 +0900 Koichi Sasada <ko1 atdot.net>
+
+ * eval.c : fix rb_iterate hook
+
+ * yarvtest/test_block.rb : add a tests for above
+
+ * vm.c : remove unused comment
+
+
2006-02-14(Tue) 12:01:06 +0900 Koichi Sasada <ko1 atdot.net>
* eval.c : fix to check passed block at block_given_p
Modified: trunk/eval.c
===================================================================
--- trunk/eval.c 2006-02-14 03:51:35 UTC (rev 413)
+++ trunk/eval.c 2006-02-14 03:51:57 UTC (rev 414)
@@ -1287,6 +1287,7 @@
volatile VALUE retval = Qnil;
NODE *node = NEW_IFUNC(bl_proc, data2);
yarv_thread_t *th = GET_THREAD();
+ yarv_control_frame_t *cfp = th->cfp;
TH_PUSH_TAG(th);
state = TH_EXEC_TAG();
@@ -1304,16 +1305,21 @@
VALUE err = th->errinfo;
if (state == TAG_BREAK) {
VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = (th->cfp + 2)->dfp;
+ VALUE *cdfp = cfp->dfp;
+
if (cdfp == escape_dfp) {
state = 0;
th->state = 0;
th->errinfo = Qnil;
}
+ else{
+ // SDR(); printf("%p, %p\n", cdfp, escape_dfp);
+ }
}
else if (state == TAG_RETRY) {
VALUE *escape_dfp = GET_THROWOBJ_CATCH_POINT(err);
- VALUE *cdfp = (th->cfp + 2)->dfp;
+ VALUE *cdfp = cfp->dfp;
+
if (cdfp == escape_dfp) {
state = 0;
th->state = 0;
Modified: trunk/test.rb
===================================================================
--- trunk/test.rb 2006-02-14 03:51:35 UTC (rev 413)
+++ trunk/test.rb 2006-02-14 03:51:57 UTC (rev 414)
@@ -1,3 +1,16 @@
+
+class E
+ include Enumerable
+
+ def each(&block)
+ [1, 2, 3].each(&block)
+ end
+end
+
+p E.new.find {|x| x == 2 }
+
+__END__
+
[].each.each
__END__
a = [1].each
Modified: trunk/vm.c
===================================================================
--- trunk/vm.c 2006-02-14 03:51:35 UTC (rev 413)
+++ trunk/vm.c 2006-02-14 03:51:57 UTC (rev 414)
@@ -1460,7 +1460,6 @@
goto vm_loop_start;
}
else {
- /* pop cref */
th->cfp++;
if (th->cfp->pc != &yarv_finish_insn_seq[0]) {
goto exception_handler;
Modified: trunk/yarvtest/test_block.rb
===================================================================
--- trunk/yarvtest/test_block.rb 2006-02-14 03:51:35 UTC (rev 413)
+++ trunk/yarvtest/test_block.rb 2006-02-14 03:51:57 UTC (rev 414)
@@ -380,4 +380,19 @@
$a
}
end
+
+ def test_c_break
+ ae %q{
+ [1,2,3].find{|x| x == 2}
+ }
+ ae %q{
+ class E
+ include Enumerable
+ def each(&block)
+ [1, 2, 3].each(&block)
+ end
+ end
+ E.new.find {|x| x == 2 }
+ }
+ end
end
--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml