From: Kushal Pal Date: Fri, 26 Jul 2024 07:51:43 +0000 (+0000) Subject: gccrs: Fixed bitwise operation in `extract_stmt` X-Git-Tag: basepoints/gcc-16~1248 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86d5412d85b907fd63b5c86817e35e506ea3f7f0;p=thirdparty%2Fgcc.git gccrs: 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 --- diff --git a/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h b/gcc/rust/checks/errors/borrowck/polonius/rust-polonius.h index b013a93671c..4447ad59430 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; }