aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-15 01:06:05 -0400
committerGitHub <noreply@github.com>2022-07-15 01:06:05 -0400
commit4c7fe74b2c0e8279d0003f820a18d59e1237b74a (patch)
tree1b88748105f7b2aa25cd6aedc8565a0e1c34b7c7 /src/value.zig
parentdd70336f3ace541586210bd7bd061cc09a8c0e03 (diff)
parent04572f6e341e6ff19877d1ae3b79e3baa653e652 (diff)
downloadzig-4c7fe74b2c0e8279d0003f820a18d59e1237b74a.tar.gz
zig-4c7fe74b2c0e8279d0003f820a18d59e1237b74a.zip
Merge pull request #12124 from ziglang/stage2-coerce-result-ptr
Sema: fix coerce_result_ptr in case of inferred result type
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/value.zig b/src/value.zig
index b52e67e31c..46624a822d 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -4935,7 +4935,16 @@ pub const Value = extern union {
/// peer type resolution. This is stored in a separate list so that
/// the items are contiguous in memory and thus can be passed to
/// `Module.resolvePeerTypes`.
- stored_inst_list: std.ArrayListUnmanaged(Air.Inst.Ref) = .{},
+ prongs: std.MultiArrayList(struct {
+ /// The dummy instruction used as a peer to resolve the type.
+ /// Although this has a redundant type with placeholder, this is
+ /// needed in addition because it may be a constant value, which
+ /// affects peer type resolution.
+ stored_inst: Air.Inst.Ref,
+ /// The bitcast instruction used as a placeholder when the
+ /// new result pointer type is not yet known.
+ placeholder: Air.Inst.Index,
+ }) = .{},
/// 0 means ABI-aligned.
alignment: u32,
},