avoid shifting into the signed bit of integers
authorMichael Gilbert <mgilbert@debian.org>
Sat, 19 Mar 2022 00:48:02 +0000 (00:48 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 19 Mar 2022 00:48:02 +0000 (00:48 +0000)
Gbp-Pq: Topic armhf
Gbp-Pq: Name shift-overflow.patch

programs/winedbg/be_arm.c

index b09bc5319b7a260f23e7b93d35165f1d2cefc1ea..18269bd0443b054676edce67277b7bd6e8a89222 100644 (file)
@@ -706,12 +706,12 @@ static UINT thumb2_disasm_branch(UINT inst, ADDRESS64 *addr)
     if (C)
     {
         offset |= I1 << 19 | I2 << 18 | (inst & 0x003f0000) >> 4;
-        if (S) offset |= 0x0fff << 20;
+        if (S) offset |= 0xfff00000;
     }
     else
     {
         offset |= I1 << 23 | I2 << 22 | (inst & 0x03ff0000) >> 4;
-        if (S) offset |= 0xff << 24;
+        if (S) offset |= 0xff000000;
     }
 
     dbg_printf("\n\tb%s%s\t", L ? "l" : "", C ? tbl_cond[(inst >> 22) & 0x0f] : "");