summaryrefslogtreecommitdiff
path: root/compile.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-08 04:43:02 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-08 04:43:02 +0000
commit8b3969f8b3c069a5b7fc0eccf65fe8e919fa4c70 (patch)
tree76d5780fee59259f0fc12ae0f2d2f075a31b871a /compile.h
parent2db158667ae995c2685eb0eb48a5b6430e112e07 (diff)
* compile.h: fix to skip inserting a trace insn.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.h')
-rw-r--r--compile.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/compile.h b/compile.h
index 92f573c8b7..4bd4e99e2c 100644
--- a/compile.h
+++ b/compile.h
@@ -164,11 +164,14 @@ PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
#define ADD_TRACE(seq, line, event) \
do { \
- if ((event) == RUBY_EVENT_LINE && iseq->coverage && RARRAY_PTR(iseq->coverage)[(line) - 1] == Qnil) { \
+ if ((event) == RUBY_EVENT_LINE && iseq->coverage && \
+ RARRAY_PTR(iseq->coverage)[(line) - 1] == Qnil) { \
RARRAY_PTR(iseq->coverage)[(line) - 1] = INT2FIX(0); \
ADD_INSN1(seq, line, trace, INT2FIX(RUBY_EVENT_COVERAGE)); \
} \
- ADD_INSN1(seq, line, trace, INT2FIX(event)); \
+ if (iseq->compile_data->option->trace_instruction) { \
+ ADD_INSN1(seq, line, trace, INT2FIX(event)); \
+ } \
}while(0);
/* add label */