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:
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user