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

ruby-changes:17789

From: mame <ko1@a...>
Date: Tue, 16 Nov 2010 00:06:26 +0900 (JST)
Subject: [ruby-changes:17789] Ruby:r29800 (trunk): * eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add

mame	2010-11-15 23:57:18 +0900 (Mon, 15 Nov 2010)

  New Revision: 29800

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29800

  Log:
    * eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add
      size_t to a pointer typed VALUE*.  Coverity Scan found this defect.

  Modified files:
    trunk/ChangeLog
    trunk/eval_intern.h

Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 29799)
+++ eval_intern.h	(revision 29800)
@@ -172,7 +172,7 @@
 #define SCOPE_SET(f)   (rb_vm_cref()->nd_visi = (f))
 
 #define CHECK_STACK_OVERFLOW(cfp, margin) do \
-  if (((VALUE *)(cfp)->sp) + (margin) + sizeof(rb_control_frame_t) >= ((VALUE *)cfp)) { \
+  if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)cfp)) { \
       rb_exc_raise(sysstack_error); \
   } \
 while (0)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29799)
+++ ChangeLog	(revision 29800)
@@ -1,3 +1,8 @@
+Mon Nov 15 23:54:45 2010  Yusuke Endoh  <mame@t...>
+
+	* eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add
+	  size_t to a pointer typed VALUE*.  Coverity Scan found this defect.
+
 Mon Nov 15 23:41:21 2010  Yusuke Endoh  <mame@t...>
 
 	* compile.c (iseq_set_exception_local_table, iseq_set_local_table,

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

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