diff options
| author | Baitinq <[email protected]> | 2025-02-12 20:41:04 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-02-12 20:41:24 +0100 |
| commit | fe5c158f6689f58351d165376b0d13c043b723fd (patch) | |
| tree | f8ff49f175a8a29c8e12f5b017c04096d2c17dee /src | |
| parent | Codegen: Dont alloca for function definitions (diff) | |
| download | interpreter-fe5c158f6689f58351d165376b0d13c043b723fd.tar.gz interpreter-fe5c158f6689f58351d165376b0d13c043b723fd.tar.bz2 interpreter-fe5c158f6689f58351d165376b0d13c043b723fd.zip | |
Codegen: Fix bug with function as variables
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.zig | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index b5f46ae..6783f96 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -131,8 +131,6 @@ pub const CodeGen = struct { std.debug.assert(self.environment.contains_variable(assignment_statement.name) != assignment_statement.is_declaration); if (assignment_statement.is_declaration and self.environment.scope_stack.items.len > 1 and assignment_statement.expression.* != .FUNCTION_DEFINITION) { - const y = core.LLVMGetLastFunction(self.llvm_module); - core.LLVMPositionBuilderAtEnd(self.builder, core.LLVMGetEntryBasicBlock(y)); const x = try std.fmt.allocPrintZ(self.arena, "{s}", .{assignment_statement.name}); const alloca = core.LLVMBuildAlloca(self.builder, core.LLVMInt64Type(), x); try self.environment.add_variable(assignment_statement.name, try self.create_variable(.{ |