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
This commit is contained in:
nobu 2017-04-05 08:34:18 +00:00
Родитель 0be01189c7
Коммит 42c13d386c
1 изменённых файлов: 5 добавлений и 17 удалений

Просмотреть файл

@ -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