]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fixed bitwise operation in `extract_stmt`
authorKushal Pal <kushalpal109@gmail.com>
Fri, 26 Jul 2024 07:51:43 +0000 (07:51 +0000)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Wed, 31 Jul 2024 06:59:09 +0000 (06:59 +0000)
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>
gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h

index ec6e6910959e76d0a9dbcf7d49335ac750ebaa5f..71dbf46f6da111076d41f78f40fcf1863305a57e 100644 (file)
@@ -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; }