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

ruby-changes:30144

From: nobu <ko1@a...>
Date: Fri, 26 Jul 2013 22:14:33 +0900 (JST)
Subject: [ruby-changes:30144] nobu:r42196 (trunk): vm_exec.h: fix CHECK_VM_STACK_OVERFLOW_FOR_INSN

nobu	2013-07-26 22:14:22 +0900 (Fri, 26 Jul 2013)

  New Revision: 42196

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

  Log:
    vm_exec.h: fix CHECK_VM_STACK_OVERFLOW_FOR_INSN
    
    * vm_exec.h (CHECK_VM_STACK_OVERFLOW_FOR_INSN): surround with
      do/while (0), and remove unnecessary casts.

  Modified files:
    trunk/ChangeLog
    trunk/vm_exec.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42195)
+++ ChangeLog	(revision 42196)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jul 26 22:14:10 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_exec.h (CHECK_VM_STACK_OVERFLOW_FOR_INSN): surround with
+	  do/while (0), and remove unnecessary casts.
+
 Fri Jul 26 20:12:07 2013  Akinori MUSHA  <knu@i...>
 
 	* ext/syslog/lib/syslog/logger.rb (Syslog::Logger): Add facility
Index: vm_exec.h
===================================================================
--- vm_exec.h	(revision 42195)
+++ vm_exec.h	(revision 42196)
@@ -169,9 +169,12 @@ default:                        \ https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L169
 #endif
 
 #define SCREG(r) (reg_##r)
-#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin) \
-  if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)(cfp))) { \
-      rb_bug("CHECK_VM_STACK_OVERFLOW_FOR_INSN: should not overflow here. Please contact ruby-core/dev with your (a part of) script. This check will be removed soon."); \
-  } while (0);
+#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin) do { \
+    if (((rb_control_frame_t *)(((cfp)->sp) + (margin)) + 1) >= (cfp)) { \
+	rb_bug("CHECK_VM_STACK_OVERFLOW_FOR_INSN: should not overflow here. " \
+	       "Please contact ruby-core/dev with your (a part of) script. " \
+	       "This check will be removed soon."); \
+    } \
+} while (0)
 
 #endif /* RUBY_VM_EXEC_H */

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

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