ruby-changes:46139
From: nobu <ko1@a...>
Date: Wed, 5 Apr 2017 17:34:22 +0900 (JST)
Subject: [ruby-changes:46139] nobu:r58253 (trunk): compile.c: remove side effects by debug macros
nobu 2017-04-05 17:34:18 +0900 (Wed, 05 Apr 2017) New Revision: 58253 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58253 Log: 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. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 58252) +++ compile.c (revision 58253) @@ -150,23 +150,11 @@ struct iseq_compile_data_ensure_node_sta https://github.com/ruby/ruby/blob/trunk/compile.c#L150 #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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/