From fa51f66ae33b6682c441676bb5c950260f7ceb2a Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 23 Jan 2019 07:49:00 +0000 Subject: [PATCH] Fix excessive sign bits in uuo link instruction. --- src/microcode/cmpintmd/aarch64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microcode/cmpintmd/aarch64.c b/src/microcode/cmpintmd/aarch64.c index be1da7d1c..54aa33e5c 100644 --- a/src/microcode/cmpintmd/aarch64.c +++ b/src/microcode/cmpintmd/aarch64.c @@ -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))); -- 2.25.1