[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Bug Report (offset+cast)

From: Rob Landley
Subject: Re: [Tinycc-devel] Bug Report (offset+cast)
Date: Fri, 11 May 2007 23:19:55 -0400
User-agent: KMail/1.9.1

On Friday 11 May 2007 9:58 am, Gil Dabah wrote:
> Hello
> I just tried to compile diStorm (http://ragestorm.net/distorm/) with TCC.
> Everything works well, except one bug I found.
> It seems you can't cast a pointer from a specified offset:
> char* s = "\x34\x34\x12";
> short word = *(short*)&s[1]; // <--buggy
> printf("%x", word);
> will print 34 instead of 1234 (on LE machine, of course).
> I also took a look at the generated code and it seems it simply ignores 
> the cast to short and reads a byte.
> The bug can be triggered when specifying offset to access the buffer, 
> without the [XXX] it won't generate erroneously code.
> Can anyone confirm?

Yes, and the very least I can do is track this:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]