diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-14 07:10:34 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-14 07:10:34 +0000 |
commit | f7035dd3ff665dce14657cf244c10c2d4b2b43c7 (patch) | |
tree | 048e5373fb8ab165a29088aaf41f02fd2f5b37d3 | |
parent | 5ce28c0642591a950e5757150137253cb8d0b9a9 (diff) | |
download | bundler-f7035dd3ff665dce14657cf244c10c2d4b2b43c7.tar.gz |
Do not reset non-increment-only counters
to prevernt underflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | debug_counter.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/debug_counter.c b/debug_counter.c index 4a0655380f..b9c32c1d15 100644 --- a/debug_counter.c +++ b/debug_counter.c @@ -47,7 +47,16 @@ VALUE rb_debug_counter_reset(void) { for (int i = 0; i < RB_DEBUG_COUNTER_MAX; i++) { - rb_debug_counter[i] = 0; + switch (i) { + case RB_DEBUG_COUNTER_mjit_length_unit_queue: + case RB_DEBUG_COUNTER_mjit_length_active_units: + case RB_DEBUG_COUNTER_mjit_length_compact_units: + // These counters may be decreased and should not be reset. + break; + default: + rb_debug_counter[i] = 0; + break; + } } return Qnil; } |