summaryrefslogtreecommitdiff
path: root/vm_exec.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 13:14:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-26 13:14:22 +0000
commit2d9a4afb137d18bf16ec99f5a841b0f232b05a16 (patch)
tree6b68d63abd1d3e02e7fcbfcbb724446b9bc55ea4 /vm_exec.h
parent9d00f3f536e40d13bfa8a80ace3c8ac1b92b18cd (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_exec.h')
-rw-r--r--vm_exec.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/vm_exec.h b/vm_exec.h
index b785c4fdd3..c92f715594 100644
--- a/vm_exec.h
+++ b/vm_exec.h
@@ -169,9 +169,12 @@ default: \
#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 */