summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-10-22 21:59:13 -0700
committerGitHub <noreply@github.com>2020-10-22 21:59:13 -0700
commit40bad72f31248c48048249b1d7536e87b4994664 (patch)
tree359862095e287cf21540c3e5040216cd6159f9f0
parent7cf34cfaa3db4b6eb63dba61108956468140564f (diff)
Assert in_gc >= 0 instead of guarding it (#3687)
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
-rw-r--r--mjit.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mjit.c b/mjit.c
index ab74a066d9..c3e2a5d98a 100644
--- a/mjit.c
+++ b/mjit.c
@@ -109,9 +109,7 @@ mjit_gc_exit_hook(void)
return;
CRITICAL_SECTION_START(4, "mjit_gc_exit_hook");
in_gc--;
- if (in_gc < 0) { // Don't allow underflow
- in_gc = 0;
- }
+ RUBY_ASSERT_ALWAYS(in_gc >= 0);
if (!in_gc) {
verbose(4, "Sending wakeup signal to workers after GC");
rb_native_cond_broadcast(&mjit_gc_wakeup);