aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-08-27 17:14:31 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-08-30 16:50:30 -0400
commite2ff486de5f3aceb21730e1feabbaf9b03432660 (patch)
tree2ee27be7108be3486d785554cc63ebd89645eec1 /src/Module.zig
parent49075d20557994da4eb341e7431de38a6df2088b (diff)
downloadzig-e2ff486de5f3aceb21730e1feabbaf9b03432660.tar.gz
zig-e2ff486de5f3aceb21730e1feabbaf9b03432660.zip
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
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig2
1 files changed, 1 insertions, 1 deletions
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() },