aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-12-11 22:06:17 +0200
committerVeikka Tuominen <git@vexu.eu>2022-12-14 14:08:21 +0200
commit886fa455fad4997cf766ec2adcbac09d7e28f668 (patch)
tree08703f05c86c640fe4ed5bfa8be24a9036fd9eeb /src
parente6588857dfb7a4528e698604d31cc2a5e26c0fb8 (diff)
downloadzig-886fa455fad4997cf766ec2adcbac09d7e28f668.tar.gz
zig-886fa455fad4997cf766ec2adcbac09d7e28f668.zip
Sema: avoid analyzing functions which failed when inlining
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 74e40687f1..6fcff1fec8 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -2257,6 +2257,9 @@ fn failWithOwnedErrorMsg(sema: *Sema, err_msg: *Module.ErrorMsg) CompileError {
sema.owner_decl.analysis = .sema_failure;
sema.owner_decl.generation = mod.generation;
}
+ if (sema.func) |func| {
+ func.state = .sema_failure;
+ }
const gop = mod.failed_decls.getOrPutAssumeCapacity(sema.owner_decl_index);
if (gop.found_existing) {
// If there are multiple errors for the same Decl, prefer the first one added.
@@ -6385,6 +6388,7 @@ fn analyzeCall(
}),
else => unreachable,
};
+ if (!is_comptime_call and module_fn.state == .sema_failure) return error.AnalysisFail;
// Analyze the ZIR. The same ZIR gets analyzed into a runtime function
// or an inlined call depending on what union tag the `label` field is