more error handling

This commit is contained in:
2026-03-16 12:26:58 +01:00
parent 720218cf31
commit fee5dc3099
12 changed files with 98 additions and 49 deletions

View File

@@ -746,6 +746,7 @@ _builtin_environ:
Expr::New(struct_name) => {
let struct_fields = &self.analyzer.structs[&struct_name.lexeme];
// TODO: panic on mem.alloc error
let memory_size = struct_fields.len() * 8;
emit!(&mut self.output, " mov rdi, {}", memory_size);
emit!(&mut self.output, " call mem.alloc");