[PATCH] Fix decoding of CBZ / CBNZ Thumb2 Instructions

Kevin Enderby enderby at apple.com
Wed Mar 27 17:53:56 PDT 2013


Looks good.  I'll commit tomorrow when I get back to work unless someone beats me to it.

Kev

On Mar 27, 2013, at 4:53 PM, Gordon Keiser <gkeiser at arxan.com> wrote:

> Hi,
>  
> According to ARM DDI0406C, A8.8.29, the CBNZ / CBZ instructions can only branch forwards, and the immediate is zero extended.   The decode function (DecodeThumbCmpBROperand) was sign extending instead, producing incorrect results when the high bit of the immediate was set. 
>  
> The attached patch fixes the issue and adds a test case which will trigger it in current code.
>  
> I don’t have commit access yet, so if it looks good and you do have, feel free to commit.
>  
> Cheers,
> Gordon Keiser
> Software Development Engineer
> Arxan Technologies
> w:+1.765.889.4756   m:+1.765.237.4833 
> gkeiser at arxan.com        www.arxan.com 
> Protecting the App Economy™ 
>  
> <DecodeCBZCorrectImm.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130327/89718822/attachment.html>


More information about the llvm-commits mailing list