]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fixed bitwise operation in `extract_stmt`
authorKushal Pal <kushalpal109@gmail.com>
Fri, 26 Jul 2024 07:51:43 +0000 (07:51 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 19 Mar 2025 14:32:01 +0000 (15:32 +0100)
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 b013a93671c5c97a17b8ea57de4a2df1d4adc42f..4447ad5943046eae6e8237f4d9825a1e5c5e82a4 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; }