mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
llvm: add assert to reliably catch undefined value use
This assert makes it possible to detect a regression of #13030 in the future without relying on undefined value tracking.
This commit is contained in:
parent
b7bd44a654
commit
272e31227c
@ -2332,10 +2332,13 @@ pub const Object = struct {
|
||||
// buffer is only used for int_type, `builtin` is a struct.
|
||||
const builtin_ty = mod.declPtr(builtin_decl).val.toType(undefined);
|
||||
const builtin_namespace = builtin_ty.getNamespace().?;
|
||||
const stack_trace_decl = builtin_namespace.decls
|
||||
const stack_trace_decl_index = builtin_namespace.decls
|
||||
.getKeyAdapted(stack_trace_str, Module.DeclAdapter{ .mod = mod }).?;
|
||||
const stack_trace_decl = mod.declPtr(stack_trace_decl_index);
|
||||
|
||||
return mod.declPtr(stack_trace_decl).val.toType(undefined);
|
||||
// Sema should have ensured that StackTrace was analyzed.
|
||||
assert(stack_trace_decl.has_tv);
|
||||
return stack_trace_decl.val.toType(undefined);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user