src/base/bitfield.hh:
bit_val was being used directly in the statement in
return. If type B had fewer bits than last, bit_val << last would get
the wrong answer.
--HG--
extra : convert_revision :
cbc43ccd139f82ebbd65f30af5d05b87c4edac64
T
insertBits(T val, int first, int last, B bit_val)
{
+ T t_bit_val = bit_val;
T bmask = mask(first - last + 1) << last;
- return ((bit_val << last) & bmask) | (val & ~bmask);
+ return ((t_bit_val << last) & bmask) | (val & ~bmask);
}
/**