summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-15 14:57:18 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-15 14:57:18 (GMT)
commit9ffd060b30b85a1783d6dd81dd41ebf447e9b3e1 (patch)
treef6dc180cf39b5a53430814212331a335439d23dd
parent7b7210439cac9a1b6b35035cb59af8a4fd8488ee (diff)
* eval_intern.h (CHECK_STACK_OVERFLOW): it was not intended to add
size_t to a pointer typed VALUE*. Coverity Scan found this defect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--eval_intern.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e0963f..7175889 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Nov 15 23:54:45 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * 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@tsg.ne.jp>
* compile.c (iseq_set_exception_local_table, iseq_set_local_table,
diff --git a/eval_intern.h b/eval_intern.h
index 549953a..428a2d8 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -172,7 +172,7 @@ enum ruby_tag_type {
#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)