Fix excessive sign bits in uuo link instruction.
authorTaylor R Campbell <campbell@mumble.net>
Wed, 23 Jan 2019 07:49:00 +0000 (07:49 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 21 Aug 2019 21:34:05 +0000 (21:34 +0000)
src/microcode/cmpintmd/aarch64.c

index be1da7d1c7aea4f431034da0cba91f5348e003e4..54aa33e5ca0c65aa9b45f5cc42c375ba63000593 100644 (file)
@@ -280,8 +280,8 @@ write_uuo_insns (insn_t * target, insn_t * iaddr, int pcrel)
            {
              unsigned lo12 =
                (((uintptr_t) to_pc) - (((uintptr_t) to_pg) << 12));
-             unsigned pglo2 = (((unsigned long) pgoff) & 3);
-             unsigned pghi19 = (((unsigned long) pgoff) >> 2);
+             unsigned pglo2 = (pgoff & 3);
+             unsigned pghi19 = ((pgoff & 0x001fffff) >> 2);
              assert (to_pc == ((char *) (to_pg + lo12)));
              assert
                (to_pg == (from_pg + (((unsigned long) pghi19 << 2) | pglo2)));