aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-05 08:34:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-05 08:34:18 +0000
commitb74912bb7da0fe42baeeaa39ee4f602d450fca12 (patch)
treea5265dbe3460def6d30e74fa51d3785807bdb218 /compile.c
parent4b4dfbb5cf1b90829b7c757aca64c1cae72a23af (diff)
downloadruby-b74912bb7da0fe42baeeaa39ee4f602d450fca12.tar.gz
compile.c: remove side effects by debug macros
* compile.c (debugp_param): do not evaluate arguments of debug macros, unless the debug mode is enabled. these macros should not have side effects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/compile.c b/compile.c
index ab0dbf70ea..906e89a650 100644
--- a/compile.c
+++ b/compile.c
@@ -150,23 +150,11 @@ struct iseq_compile_data_ensure_node_stack {
#else
-static inline ID
-r_id(ID id)
-{
- return id;
-}
-
-static inline VALUE
-r_value(VALUE value)
-{
- return value;
-}
-
-#define debugi(header, id) r_id(id)
-#define debugp(header, value) r_value(value)
-#define debugp_verbose(header, value) r_value(value)
-#define debugp_verbose_node(header, value) r_value(value)
-#define debugp_param(header, value) r_value(value)
+#define debugi(header, id) ((void)0)
+#define debugp(header, value) ((void)0)
+#define debugp_verbose(header, value) ((void)0)
+#define debugp_verbose_node(header, value) ((void)0)
+#define debugp_param(header, value) ((void)0)
#define debug_node_start(node) ((void)0)
#define debug_node_end() ((void)0)
#endif