diff --git a/compiler-rt/lib/scudo/standalone/primary32.h b/compiler-rt/lib/scudo/standalone/primary32.h --- a/compiler-rt/lib/scudo/standalone/primary32.h +++ b/compiler-rt/lib/scudo/standalone/primary32.h @@ -553,7 +553,7 @@ // TODO(chiahungduan): Avoid the use of push_back() in `Batches` of // BatchClassId. BG->Batches.push_front(CurBatch); - UnusedSlots = BG->MaxCachedPerBatch - 1; + UnusedSlots = static_cast(BG->MaxCachedPerBatch - 1); } // `UnusedSlots` is u16 so the result will be also fit in u16. const u16 AppendSize = static_cast(Min(UnusedSlots, Size - I)); diff --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h --- a/compiler-rt/lib/scudo/standalone/primary64.h +++ b/compiler-rt/lib/scudo/standalone/primary64.h @@ -665,7 +665,7 @@ // TODO(chiahungduan): Avoid the use of push_back() in `Batches` of // BatchClassId. BG->Batches.push_front(CurBatch); - UnusedSlots = BG->MaxCachedPerBatch - 1; + UnusedSlots = static_cast(BG->MaxCachedPerBatch - 1); } // `UnusedSlots` is u16 so the result will be also fit in u16. const u16 AppendSize = static_cast(Min(UnusedSlots, Size - I));