From: Gabe Black Date: Tue, 8 May 2007 17:19:33 +0000 (+0000) Subject: Fix insertBits so it doesn't shift things into oblivion X-Git-Tag: m5_2.0_beta4~311^2~2^2~1^2^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2ac0fd89b9928f653e1485b2432cd71b455d7c5;p=gem5.git Fix insertBits so it doesn't shift things into oblivion --HG-- extra : convert_revision : 8833b60e3fc94c917fbdb7a99f3d90155907b44e --- diff --git a/src/base/bitfield.hh b/src/base/bitfield.hh index 69cce2245..518bad6b8 100644 --- a/src/base/bitfield.hh +++ b/src/base/bitfield.hh @@ -96,8 +96,9 @@ inline 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); } /**