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 | f0fd30552864c6556427c8d3fd444380b6456d60 (patch) | |
tree | ff4f30e8404e5c6e5dd8fa539c1e5de757984366 /vm_core.h | |
parent | a3b89d7493d25925a80dc874723cf53fdb0d9c69 (diff) | |
download | ruby-f0fd30552864c6556427c8d3fd444380b6456d60.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
Diffstat (limited to 'vm_core.h')
-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 |