base: Fix assigning between identical bitfields.
authorGabe Black <gabeblack@google.com>
Wed, 7 Jan 2015 08:31:46 +0000 (00:31 -0800)
committerGabe Black <gabeblack@google.com>
Wed, 7 Jan 2015 08:31:46 +0000 (00:31 -0800)
commit86dea86987ef61192deca4d2f1a980893f50e092
tree7681649cfe2f9d0cb464dc2252e657c1acb7e3d7
parentd0284544ec339808c2273ced3ebc566cad285a4a
base: Fix assigning between identical bitfields.

If two bitfields are of the same type, also implying that they have the same
first and last bit positions, the existing implementation would copy the
entire bitfield. That includes the __data member which is shared among all the
bitfields, effectively overwritting the entire bitunion.

This change also adjusts the write only signed bitfield assignment operator to
be like the unsigned version, using "using" instead of implementing it again
and calling down to the underlying implementation.
src/base/bitunion.hh