fix(selfhost-lower): null-guard Lcx_SubstEnumName — hStore nodes with null typeName segfaulted buxc2 project (bux_strlen(NULL) via String_Len)

This commit is contained in:
2026-07-28 21:17:21 +03:00
parent a0bed68cbf
commit ea5ba70528
+3
View File
@@ -682,6 +682,9 @@ module HirLower {
} }
func Lcx_SubstEnumName(ctx: *LowerCtx, name: String) -> String { 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 // If name is a bare generic enum name, mangle to concrete name
var ge: *Decl = Lcx_FindGenericEnum(ctx, name); var ge: *Decl = Lcx_FindGenericEnum(ctx, name);
if ge != null as *Decl { if ge != null as *Decl {