aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-10-22 15:12:22 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-22 15:35:35 -0700
commit069c83d58cebba88275ee76ba01fabcd8e964573 (patch)
treeab7e52f307bd23869e2461189383522dc64f42de /src/Module.zig
parent86b92809635607ff357ce96902e2aaf83c3fd029 (diff)
downloadzig-069c83d58cebba88275ee76ba01fabcd8e964573.tar.gz
zig-069c83d58cebba88275ee76ba01fabcd8e964573.zip
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.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig1
1 files changed, 1 insertions, 0 deletions
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;
}