diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-11 02:35:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-11 02:35:46 +0000 |
commit | 428d52c157533852d8f2817ece298d2c433ff79b (patch) | |
tree | ff4f30e8404e5c6e5dd8fa539c1e5de757984366 | |
parent | 7ed018698200e5de67ec2eca5c9c320f1d575d58 (diff) | |
download | ruby-428d52c157533852d8f2817ece298d2c433ff79b.tar.gz |
vm_core.h: make VM_ASSERT an expression
* vm_core.h (VM_ASSERT): make an expression, as well as standard
assert().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vm_core.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -21,11 +21,11 @@ #endif #if VM_CHECK_MODE > 0 -#define VM_ASSERT(expr) do { \ - if(!(expr)) rb_bug("%s:%d assertion violation - %s", __FILE__, __LINE__, #expr); \ -} while (0) +#define VM_ASSERT(expr) ( \ + LIKELY(expr) ? (void)0 : \ + rb_bug("%s:%d assertion violation - %s", __FILE__, __LINE__, #expr)) #else -#define VM_ASSERT(expr) +#define VM_ASSERT(expr) ((void)0) #endif #define RUBY_VM_THREAD_MODEL 2 |