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

ruby-changes:27230

From: ktsj <ko1@a...>
Date: Sat, 16 Feb 2013 21:06:27 +0900 (JST)
Subject: [ruby-changes:27230] ktsj:r39282 (trunk): * vm.c (ENV_IN_HEAP_P): fix off-by-one error.

ktsj	2013-02-16 20:58:33 +0900 (Sat, 16 Feb 2013)

  New Revision: 39282

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

  Log:
    * vm.c (ENV_IN_HEAP_P): fix off-by-one error.

  Modified files:
    trunk/ChangeLog
    trunk/vm.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39281)
+++ ChangeLog	(revision 39282)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Feb 16 20:51:17 2013  Kazuki Tsujimoto  <kazuki@c...>
+
+	* vm.c (ENV_IN_HEAP_P): fix off-by-one error.
+
 Sat Feb 16 20:47:16 2013  Akinori MUSHA  <knu@i...>
 
 	* configure.in (LIBRUBY_DLDFLAGS): Fix a bug where --with-opt-dir
Index: vm.c
===================================================================
--- vm.c	(revision 39281)
+++ vm.c	(revision 39282)
@@ -262,7 +262,7 @@ ruby_vm_run_at_exit_hooks(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/vm.c#L262
  */
 
 #define ENV_IN_HEAP_P(th, env)  \
-  (!((th)->stack < (env) && (env) < ((th)->stack + (th)->stack_size)))
+  (!((th)->stack <= (env) && (env) < ((th)->stack + (th)->stack_size)))
 #define ENV_VAL(env)        ((env)[1])
 
 static void

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

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