Skip to content

Commit

Permalink
Fixed bitwise operation in extract_stmt
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* checks/errors/borrowck/polonius/rust-polonius.h (struct FullPoint):
	This is the correct way of extracting the required bits.

Signed-off-by: Kushal Pal <[email protected]>
  • Loading branch information
braw-lee authored and P-E-P committed Jul 31, 2024
1 parent d55bbc2 commit 3b58014
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct FullPoint
static uint32_t extract_bb (Point point) { return point >> 16; }
static uint32_t extract_stmt (Point point)
{
return (point & ~(1 << 16)) >> 1;
return (point >> 1) & ((1 << 15) - 1);
}
static bool extract_mid (Point point) { return point & 1; }

Expand Down

0 comments on commit 3b58014

Please sign in to comment.