fix(selfhost): resolve segfault in buxc2 compiling src/

- Replace Decl's 256 inline struct fields with dynamic fields: *StructField
  array to avoid parser field limit truncation and name shifts.
- Update parser.bux and hir_lower.bux to use decl.fields[i].
- Fix uninitialized Symbol.refType in three stack-allocated Symbol sites:
  loopSym (for-loop iterator), vSym (enum variants), and HIR param sym.
  Garbage refType values (e.g. 0xFF) were leaking into scope tables,
  later copied to expr->refType, causing SIGSEGV in Lcx_LowerExpr.
This commit is contained in:
2026-06-09 15:03:45 +03:00
parent 0c41c7bb25
commit 4a860095fd
6 changed files with 66 additions and 1287 deletions
+5
View File
@@ -323,6 +323,11 @@ func lexScanIdent(lex: *Lexer) {
lex.tokens[lex.tokenCount] = tok;
lex.tokenCount = lex.tokenCount + 1;
}
if String_StartsWith(tok.text, "field") {
PrintLine(String_Concat("DEBUG lexer ident=", tok.text));
PrintLine(String_Concat("DEBUG lexer addr=", bux_int_to_str(tok.text as int64)));
PrintLine(String_Concat("DEBUG lexer pos=", bux_int_to_str(lex.tokenCount as int64)));
}
}
// ---------------------------------------------------------------------------