Skip to content

Commit a7e6465

Browse files
committed
fold: cast offsets to untyped before widening
1 parent e95d02c commit a7e6465

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/shady/fold.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ static void reapply_ptr_casts(const Node* old, PtrCasts casts, const Node** new)
258258

259259
static const Node* to_ptr_size(const Node* n) {
260260
IrArena* a = n->arena;
261+
const Type* nt = shd_get_unqualified_type(n->type);
262+
assert(nt->tag == Int_TAG);
263+
Int payload = nt->payload.int_type;
264+
payload.is_signed = false;
265+
n = bit_cast_helper(a, int_type(a, payload), n);
261266
return conversion_helper(a, shd_uint64_type(a), n);
262267
}
263268

0 commit comments

Comments
 (0)