From 13016ebc5a315a4883203602cbadc2ee5d45f2d6 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Wed, 27 Jan 2021 08:03:00 +0100 Subject: [PATCH] cmsfs-fuse: ASAN fix dec_to_hex() and hex_to_dec() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the following compiler errors when ASAN is enabled: CC cmsfs-fuse/cmsfs-fuse.o cmsfs-fuse.c: Assembler messages: cmsfs-fuse.c:310: Error: operand out of range (0xffffffffffffff00 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:310: Error: operand out of range (0xffffffffffffff00 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:310: Error: operand out of range (0xffffffffffffff00 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:310: Error: operand out of range (0xffffffffffffff00 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:310: Error: operand out of range (0xffffffffffffff00 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:310: Error: operand out of range (0xffffffffffffff00 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:302: Error: operand out of range (0xfffffffffffffda0 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:302: Error: operand out of range (0xfffffffffffffda0 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:302: Error: operand out of range (0xfffffffffffffda0 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:302: Error: operand out of range (0xfffffffffffffda0 is not between 0x0000000000000000 and 0x0000000000000fff) cmsfs-fuse.c:302: Error: operand out of range (0xfffffffffffffda0 is not between 0x0000000000000000 and 0x0000000000000fff) Signed-off-by: Alexander Egorenkov Reviewed-by: Philipp Rudo Signed-off-by: Jan Höppner --- cmsfs-fuse/cmsfs-fuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmsfs-fuse/cmsfs-fuse.c b/cmsfs-fuse/cmsfs-fuse.c index 89e42ebe..67de9db4 100644 --- a/cmsfs-fuse/cmsfs-fuse.c +++ b/cmsfs-fuse/cmsfs-fuse.c @@ -299,7 +299,7 @@ static unsigned long dec_to_hex(unsigned long long num) { unsigned long res; - asm volatile("cvb %0,%1" : "=d" (res) : "m" (num)); + asm volatile("cvb %0,%1" : "=d" (res) : "Q" (num)); return res & 0xffffffff; } @@ -307,7 +307,7 @@ static unsigned int hex_to_dec(unsigned int num) { unsigned long long res; - asm volatile("cvd %1,%0" : "=m" (res) : "d" (num)); + asm volatile("cvd %1,%0" : "=Q" (res) : "d" (num)); return res & 0xffffffff; }