From 069c83d58cebba88275ee76ba01fabcd8e964573 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 22 Oct 2021 15:12:22 -0700 Subject: stage2: change `@bitCast` to always be by-value After a discussion about language specs, this seems like the best way to go, because it's simpler to reason about both for humans and compilers. The `bitcast_result_ptr` ZIR instruction is no longer needed. This commit also implements writing enums, arrays, and vectors to virtual memory at compile-time. This unlocked some more of compiler-rt being able to build, which in turn unlocks saturating arithmetic behavior tests. There was also a memory leak in the comptime closure system which is now fixed. --- src/Module.zig | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 58a5a50698..8677be224f 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -317,6 +317,7 @@ pub const WipCaptureScope = struct { assert(!self.finalized); // use a temp to avoid unintentional aliasing due to RLS const tmp = try self.scope.captures.clone(self.perm_arena); + self.scope.captures.deinit(self.gpa); self.scope.captures = tmp; self.finalized = true; } -- cgit v1.2.3