fix(bootstrap): resolve lir lower crashes and struct-copy bugs

- Fix lirValToC crash on lvkInt in hStore raw C emission
- Add hAlloca handling to lowerExpr (returns &name, avoids unhandled fallback)
- Fix nested comment syntax in unhandled expr fallback
- Rewrite buildLval to handle hIndexPtr and nested hFieldPtr/hArrowField
  so assignments like arr[i].field = val emit direct C lvalues
- Make &&/|| temporaries unique (__and_tmp_N/__or_tmp_N) to avoid
  duplicate declarations in the same function
- Selfhost null-deref fix in sema.bux (unchained nested conditions)
This commit is contained in:
2026-06-06 21:46:25 +03:00
parent 9416c486b2
commit 3ae8c60ebb
6 changed files with 194 additions and 32 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ all: build
build:
$(NIM) c -o:$(OUT) -d:release --opt:size $(SRC)
strip $(OUT)
# strip $(OUT)
dev:
$(NIM) c -o:buxc_debug -d:debug --stackTrace:on --lineTrace:on $(SRC)
@@ -72,5 +72,5 @@ selfhost: build
@cp src/bux.toml build/selfhost/
@mv build/selfhost/src/main.bux build/selfhost/src/Main.bux 2>/dev/null || true
@cd build/selfhost && ../../$(OUT) build
@strip build/selfhost/build/buxc2 2>/dev/null || true
# strip removed for debug
@echo "=== Self-hosted compiler built successfully ==="