]> granicus.if.org Git - strace/commitdiff
Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Jan 2015 20:04:37 +0000 (20:04 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Jan 2015 01:15:07 +0000 (01:15 +0000)
* io.c (print_llu_from_low_high_val) [SIZEOF_LONG == SIZEOF_LONG_LONG
&& SUPPORTED_PERSONALITIES > 1]: Properly handle the case of
current_wordsize < sizeof(long).

io.c

diff --git a/io.c b/io.c
index 6b24159ade0360f83d15397945053f85bbccb2a5..f197076ec6edbdea85d21e9bbc4994076c1a4ec9 100644 (file)
--- a/io.c
+++ b/io.c
@@ -217,7 +217,16 @@ static void
 print_llu_from_low_high_val(struct tcb *tcp, int arg)
 {
 #if SIZEOF_LONG == SIZEOF_LONG_LONG
-       tprintf("%lu", (unsigned long) tcp->u_arg[arg]);
+# if SUPPORTED_PERSONALITIES > 1
+       if (current_wordsize == sizeof(long))
+# endif
+               tprintf("%lu", (unsigned long) tcp->u_arg[arg]);
+# if SUPPORTED_PERSONALITIES > 1
+       else
+               tprintf("%lu",
+                       ((unsigned long) tcp->u_arg[arg + 1] << current_wordsize * 8)
+                       | (unsigned long) tcp->u_arg[arg]);
+# endif
 #elif defined(LINUX_MIPSN32)
        tprintf("%llu", (unsigned long long) tcp->ext_arg[arg]);
 #else