From ea5ba705281aa5a5984fbebac4b29dcb9da752e0 Mon Sep 17 00:00:00 2001 From: dimgigov Date: Tue, 28 Jul 2026 21:17:21 +0300 Subject: [PATCH] =?UTF-8?q?fix(selfhost-lower):=20null-guard=20Lcx=5FSubst?= =?UTF-8?q?EnumName=20=E2=80=94=20hStore=20nodes=20with=20null=20typeName?= =?UTF-8?q?=20segfaulted=20buxc2=20project=20(bux=5Fstrlen(NULL)=20via=20S?= =?UTF-8?q?tring=5FLen)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hir_lower.bux | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hir_lower.bux b/src/hir_lower.bux index 7cc205b..231d2ab 100644 --- a/src/hir_lower.bux +++ b/src/hir_lower.bux @@ -682,6 +682,9 @@ module HirLower { } func Lcx_SubstEnumName(ctx: *LowerCtx, name: String) -> String { + // HIR nodes may carry null names (e.g. hStore without typeName); + // Nim tolerated nil strings, bux_strlen(NULL) segfaults. + if name == null as String { return name; } // If name is a bare generic enum name, mangle to concrete name var ge: *Decl = Lcx_FindGenericEnum(ctx, name); if ge != null as *Decl {