From 8481da18d0f546ec78bfb4e802937f7792b11ba3 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 31 Jan 2026 13:20:45 -0600 Subject: [PATCH] Add another bounds check for updating labels. Related to #1700 --- src/core/specials.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/specials.c b/src/core/specials.c index 3c981180..0f6ae408 100644 --- a/src/core/specials.c +++ b/src/core/specials.c @@ -688,7 +688,7 @@ static JanetSlot janetc_if(JanetFopts opts, int32_t argn, const Janet *argv) { labeld = janet_v_count(c->buffer); if (labeljr < labeld) { c->buffer[labeljr] |= (labelr - labeljr) << 16; - if (!tail) c->buffer[labeljd] |= (labeld - labeljd) << 8; + if (!tail && labeljd < labeld) c->buffer[labeljd] |= (labeld - labeljd) << 8; } if (tail) target.flags |= JANET_SLOT_RETURNED;