Skip to content

Commit f318498

Browse files
committed
inline.h: Add comment for the cast that might appear redundant at first glance.
(intended to be squashed before merge)
1 parent 1e6ea20 commit f318498

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

inline.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3582,6 +3582,8 @@ S_uv_mul_overflow (UV auv, UV buv, UV *const result)
35823582
/* else: eg 32 bit is at most 0xFFFF * 0xFFFF == 0xFFFE0001
35833583
so the unsigned multiply cannot overflow. */
35843584

3585+
/* (UV) cast below is necessary to force the multiplication to produce
3586+
UV result, as alow and blow might be narrower than UV */
35853587
UV product_low = (UV)alow * blow;
35863588
return S_uv_add_overflow(product_middle, product_low, result);
35873589
}

0 commit comments

Comments
 (0)