From 40bad72f31248c48048249b1d7536e87b4994664 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 22 Oct 2020 21:59:13 -0700 Subject: [PATCH] Assert in_gc >= 0 instead of guarding it (#3687) --- mjit.c | 4 +--- 1 file changed, 1 insertion(+), 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);