From e2ff486de5f3aceb21730e1feabbaf9b03432660 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sun, 27 Aug 2023 17:14:31 -0400 Subject: Sema: cleanup `coerceExtra` * remove unreachable code * remove already handled cases * avoid `InternPool.getCoerced` * add some undef checks * error when converting undef int to float Closes #16987 --- src/Module.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index ba76c16faf..c3377225c6 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -6360,7 +6360,7 @@ pub fn errorSetFromUnsortedNames( /// Supports only pointers, not pointer-like optionals. pub fn ptrIntValue(mod: *Module, ty: Type, x: u64) Allocator.Error!Value { - assert(ty.zigTypeTag(mod) == .Pointer); + assert(ty.zigTypeTag(mod) == .Pointer and !ty.isSlice(mod)); const i = try intern(mod, .{ .ptr = .{ .ty = ty.toIntern(), .addr = .{ .int = (try mod.intValue_u64(Type.usize, x)).toIntern() }, -- cgit v1.2.3