aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pal <kushalpal109@gmail.com>2024-07-26 07:51:43 +0000
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2024-07-31 06:59:09 +0000
commit3b5801409dc15c6fed57750c0c90ae8a4599ab3e (patch)
treeea170257242869684c4660f046f558a39e21ec97
parentd55bbc2e8facd00ed1a046e1657023aa8474e36e (diff)
downloadgcc-3b5801409dc15c6fed57750c0c90ae8a4599ab3e.zip
gcc-3b5801409dc15c6fed57750c0c90ae8a4599ab3e.tar.gz
gcc-3b5801409dc15c6fed57750c0c90ae8a4599ab3e.tar.bz2
Fixed bitwise operation in `extract_stmt`
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 <kushalpal109@gmail.com>
-rw-r--r--gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
index ec6e691..71dbf46 100644
--- a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
+++ b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h
@@ -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; }