FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OMF bug

 
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries
View previous topic :: View next topic  
Author Message
pmoore



Joined: 08 May 2006
Posts: 3
Location: London, England

PostPosted: Mon May 08, 2006 3:47 pm    Post subject: OMF bug Reply with quote

Hi,

I found a small bug in the OMFBinary parseFIXUPP method.

in the fixup subrecord parsing, you call

Code:
reader.get(offset)


offset is a ubyte. So far so good, but you then do

Code:
offset |= (type & 0b00000011) << 8; // get the high-order bits from the 'locat'


This will truncate the high order bits off the top end of offset.
What you want here instead is something like

Code:
uint offset2 = offset | ((type & 0b00000011) << 8);


and then use this value later when setting the destOffset:

Code:
fix.destOffset = enumData.offset + offset2;


PS. Keep up the good work.

Regards,

Peter
Back to top
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Mon May 08, 2006 7:29 pm    Post subject: Reply with quote

Wow. Awesome. Thanks for the bugfix.

It took me a minute, but I hadn't realized that I was using only 8-bit precision in there. Oops. Smile
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
pmoore



Joined: 08 May 2006
Posts: 3
Location: London, England

PostPosted: Tue May 09, 2006 2:58 pm    Post subject: Reply with quote

You're welcome. There's more...

In the same class (parseCOMDAT method) you do nothing on a COMDAT continuation. I believe you need to update the dataOffset of the global enumData so that fixup offsets (which are relative to this value) larger than 1023 are correct otherwise you end up with random data when the fixup occurs Surprised

Code:
if(flags & 1){
   // continuation
   // do nothing
}


needs to be:

Code:
if(flags & 1){
   // continuation
   // update the dataOffset for this COMDAT
   this.enumData.offset = dataOffset;
}


Regards,
Peter
Back to top
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Tue May 09, 2006 3:07 pm    Post subject: Reply with quote

Again, thanks for taking the time to report stuff like this - I'll be adding this fix soon.

FYI, I've added your name to the list of project contributors. Wink
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
pmoore



Joined: 08 May 2006
Posts: 3
Location: London, England

PostPosted: Tue May 09, 2006 3:46 pm    Post subject: Reply with quote

Nice one Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group