Sema: fix false negative Value.isComptimePtr for slices

This commit is contained in:
Andrew Kelley 2023-04-27 17:27:13 -07:00
parent 624c3069b4
commit 6931f6c5be
2 changed files with 2 additions and 1 deletions

View File

@ -575,7 +575,7 @@ const mnemonic_to_encodings_map = init: {
.modrm_ext = entry[4],
.mode = entry[5],
};
// TODO: use `@memcpy` for these. When I did that, I got an false positive
// TODO: use `@memcpy` for these. When I did that, I got a false positive
// compile error for this copy happening at compile time.
std.mem.copyForwards(Op, &data.ops, entry[2]);
std.mem.copyForwards(u8, &data.opc, entry[3]);

View File

@ -2789,6 +2789,7 @@ pub const Value = extern union {
.field_ptr => isComptimeMutablePtr(val.castTag(.field_ptr).?.data.container_ptr),
.eu_payload_ptr => isComptimeMutablePtr(val.castTag(.eu_payload_ptr).?.data.container_ptr),
.opt_payload_ptr => isComptimeMutablePtr(val.castTag(.opt_payload_ptr).?.data.container_ptr),
.slice => isComptimeMutablePtr(val.castTag(.slice).?.data.ptr),
else => false,
};