From: Dmitry V. Levin Date: Fri, 23 Jan 2015 20:04:37 +0000 (+0000) Subject: Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures X-Git-Tag: v4.10~177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;ds=sidebyside;h=5de5a7abd5c172c7dbaf5e65428569d58ec2b712;p=strace Fix ILP32 personality preadv/pwritev offset decoding on LP64 architectures * 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). --- diff --git a/io.c b/io.c index 6b24159a..f197076e 100644 --- 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