Skip to content

Commit

Permalink
insn_impl_threads.h: explicit casts in ATOMIC_RMW to suppress ubsan
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Apr 24, 2023
1 parent 931891a commit 78738dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/insn_impl_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ fail: \
uint##MEM##_t new_le; \
do { \
old_le = *ap; \
old_h = le##MEM##_to_host(old_le); \
old_h = (uint##STACK##_t)le##MEM##_to_host( \
old_le); \
uint##STACK##_t new_h = \
OP(STACK, old_h, val_v.u.i##STACK); \
new_le = host_to_le##MEM(new_h); \
new_le = host_to_le##MEM( \
(uint##MEM##_t)new_h); \
} while (!CMPXCHG(ap, &old_le, new_le)); \
val_readv.u.i##STACK = old_h; \
} \
Expand Down

0 comments on commit 78738dc

Please sign in to comment.