diff --git a/ChangeLog b/ChangeLog index 5d36ee129c..25ffe0f9ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Feb 16 20:51:17 2013 Kazuki Tsujimoto + + * vm.c (ENV_IN_HEAP_P): fix off-by-one error. + Sat Feb 16 20:47:16 2013 Akinori MUSHA * configure.in (LIBRUBY_DLDFLAGS): Fix a bug where --with-opt-dir diff --git a/vm.c b/vm.c index 3b404984cc..49cc24e2b9 100644 --- a/vm.c +++ b/vm.c @@ -262,7 +262,7 @@ ruby_vm_run_at_exit_hooks(rb_vm_t *vm) */ #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