mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
Fix recover_access_chain_from_offset on unsized fields (#510)
This commit is contained in:
parent
4bd0dcaf3f
commit
3bc8a8076b
@ -405,7 +405,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
let field_ty_kind = self.lookup_type(field_ty);
|
||||
|
||||
let offset_in_field = offset - field_offset;
|
||||
if offset_in_field < field_ty_kind.sizeof(self)? {
|
||||
if field_ty_kind
|
||||
.sizeof(self)
|
||||
.map_or(true, |size| offset_in_field < size)
|
||||
{
|
||||
Some((i, field_ty, field_ty_kind, offset_in_field))
|
||||
} else {
|
||||
None
|
||||
|
Loading…
Reference in New Issue
Block a user