From 5de5a7abd5c172c7dbaf5e65428569d58ec2b712 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 23 Jan 2015 20:04:37 +0000 Subject: [PATCH] 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). --- io.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- 2.40.0