Skip to content

Commit 699e066

Browse files
committedApr 1, 2015
Fix set_bits
1 parent 337e79c commit 699e066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/util/numeric.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ inline u32 get_bits(u32 x, u32 pos, u32 len)
258258
inline void set_bits(u32 *x, u32 pos, u32 len, u32 val)
Has a conversation. Original line has a conversation.
259259
{
260260
u32 mask = (1 << len) - 1;
261-
*x &= ~(mask << len);
261+
*x &= ~(mask << pos);
262262
*x |= (val & mask) << pos;
263263
}
264264

0 commit comments

Comments
 (0)
Please sign in to comment.