aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authoryujiri8 <yujiri@disroot.org>2023-05-31 07:15:52 -0400
committerGitHub <noreply@github.com>2023-05-31 11:15:52 +0000
commitcd1417dbdf098634641e87dba4c3be2806d76250 (patch)
tree86f37e2015cb84fd08ec260772b7bb6b40686811 /src/Sema.zig
parent32e719e070067333efa9d4888927b425d118fc97 (diff)
downloadzig-cd1417dbdf098634641e87dba4c3be2806d76250.tar.gz
zig-cd1417dbdf098634641e87dba4c3be2806d76250.zip
don't crash when can't evaluate comptime expression with inferred type
Closes #15911.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 282a16b27a..52eba5bc5c 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -882,7 +882,7 @@ fn analyzeBodyInner(
var dbg_block_begins: u32 = 0;
- // We use a while(true) loop here to avoid a redundant way of breaking out of
+ // We use a while (true) loop here to avoid a redundant way of breaking out of
// the loop. The only way to break out of the loop is with a `noreturn`
// instruction.
var i: usize = 0;
@@ -18073,7 +18073,7 @@ fn zirStructInitAnon(
return sema.addConstantMaybeRef(block, tuple_ty, tuple_val, is_ref);
};
- sema.requireRuntimeBlock(block, src, .unneeded) catch |err| switch (err) {
+ sema.requireRuntimeBlock(block, .unneeded, null) catch |err| switch (err) {
error.NeededSourceLocation => {
const decl = sema.mod.declPtr(block.src_decl);
const field_src = Module.initSrc(src.node_offset.x, sema.gpa, decl, runtime_index);
@@ -18179,7 +18179,7 @@ fn zirArrayInit(
return sema.addConstantMaybeRef(block, array_ty, array_val, is_ref);
};
- sema.requireRuntimeBlock(block, src, .unneeded) catch |err| switch (err) {
+ sema.requireRuntimeBlock(block, .unneeded, null) catch |err| switch (err) {
error.NeededSourceLocation => {
const decl = sema.mod.declPtr(block.src_decl);
const elem_src = Module.initSrc(src.node_offset.x, sema.gpa, decl, runtime_index);