qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension
Date: Fri, 31 Mar 2017 17:59:33 +0200	[thread overview]
Message-ID: <20170331155933.GG9606@toto> (raw)
In-Reply-To: <1490970671-20560-1-git-send-email-peter.maydell@linaro.org>

On Fri, Mar 31, 2017 at 03:31:11PM +0100, Peter Maydell wrote:
> Commit 001ebaca7b11 fixed some unintended sign extension issues
> spotted by Coverity (CID 1005402, 1005403), but didn't catch
> all of them. Fix the rest, so we behave consistently whether
> 'long' is 32 bit or 64 bit.

Thanks!
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  disas/cris.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/disas/cris.c b/disas/cris.c
> index 30217f1..2dd56de 100644
> --- a/disas/cris.c
> +++ b/disas/cris.c
> @@ -2048,7 +2048,7 @@ print_with_operands (const struct cris_opcode *opcodep,
>  	  {
>  	    /* We're looking at [pc+], i.e. we need to output an immediate
>  	       number, where the size can depend on different things.  */
> -	    long number;
> +	    int32_t number;
>  	    int signedp
>  	      = ((*cs == 'z' && (insn & 0x20))
>  		 || opcodep->match == BDAP_QUICK_OPCODE);
> @@ -2290,7 +2290,7 @@ print_with_operands (const struct cris_opcode *opcodep,
>  
>  		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)
>  		      {
> -			long number;
> +			int32_t number;
>  			unsigned int nbytes;
>  
>  			/* It's a value.  Get its size.  */
> -- 
> 2.7.4
> 

  reply	other threads:[~2017-03-31 15:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 14:31 [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension Peter Maydell
2017-03-31 15:59 ` Edgar E. Iglesias [this message]
2017-04-03 13:39   ` Peter Maydell
2017-04-02  6:31 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170331155933.GG9606@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).