[前][次][番号順一覧][スレッド一覧]

ruby-changes:2030

From: ko1@a...
Date: 26 Sep 2007 19:40:11 +0900
Subject: [ruby-changes:2030] ko1 - Ruby:r13521 (trunk): * eval.c (eval): fix to check stack overflow.

ko1	2007-09-26 19:39:49 +0900 (Wed, 26 Sep 2007)

  New Revision: 13521

  Modified files:
    trunk/ChangeLog
    trunk/eval.c
    trunk/eval_intern.h
    trunk/vm.h

  Log:
    * eval.c (eval): fix to check stack overflow.
    * eval_intern.h, vm.h: move CHECK_STACK_OVERFLOW() macro.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/vm.h?r1=13521&r2=13520
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13521&r2=13520
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval.c?r1=13521&r2=13520
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval_intern.h?r1=13521&r2=13520

Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 13520)
+++ eval_intern.h	(revision 13521)
@@ -186,6 +186,12 @@
   ruby_cref()->nd_visi = (f); \
 }
 
+#define CHECK_STACK_OVERFLOW(cfp, margin) do \
+  if (((VALUE *)(cfp)->sp) + (margin) >= ((VALUE *)cfp)) { \
+      rb_exc_raise(sysstack_error); \
+  } \
+while (0)
+
 void rb_thread_cleanup _((void));
 void rb_thread_wait_other_threads _((void));
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13520)
+++ ChangeLog	(revision 13521)
@@ -1,3 +1,9 @@
+Wed Sep 26 19:36:26 2007  Koichi Sasada  <ko1@a...>
+
+	* eval.c (eval): fix to check stack overflow.
+
+	* eval_intern.h, vm.h: move CHECK_STACK_OVERFLOW() macro.
+
 Wed Sep 26 19:27:11 2007  Koichi Sasada  <ko1@a...>
 
 	* insnhelper.ci (vm_throw): fix to move increment point.
Index: eval.c
===================================================================
--- eval.c	(revision 13520)
+++ eval.c	(revision 13521)
@@ -1735,6 +1735,7 @@
 	}
 
 	/* kick */
+	CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
 	result = vm_eval_body(th);
     }
     POP_TAG();
Index: vm.h
===================================================================
--- vm.h	(revision 13520)
+++ vm.h	(revision 13521)
@@ -214,12 +214,6 @@
   ((rb_control_frame_t *)(th->stack + th->stack_size) - (rb_control_frame_t *)(cfp))
 #define VM_SP_CNT(th, sp) ((sp) - (th)->stack)
 
-#define CHECK_STACK_OVERFLOW(cfp, margin) do \
-  if (((VALUE *)(cfp)->sp) + (margin) >= ((VALUE *)cfp)) { \
-      rb_exc_raise(sysstack_error); \
-  } \
-while (0)
-
 /*
   env{
     env[0] // special (block or prev env)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]