login | about | faq

If you have any feedback from our EAP, we've created a UserVoice forum especially for you! Check it out, and let us know what you think of the latest Early Access build.

To whom it may concern;

I'm a licensed user of .Net Reflector (v. 7.4.1.180) and discovered a problem that I'd like to have fixed.

If you reflect / dissasemble .Net framework's mscorlib assembly, specifically System.IO.BinaryReader.ReadInt64(); .Net Reflector reports:

public virtual long ReadInt64() { this.FillBuffer(8); uint num = (uint) (((this.m_buffer[0] | (this.m_buffer[1] << 8)) | (this.m_buffer[2] << 0x10)) | (this.m_buffer[3] << 0x18)); uint num2 = (uint) (((this.m_buffer[4] | (this.m_buffer[5] << 8)) | (this.m_buffer[6] << 0x10)) | (this.m_buffer[7] << 0x18)); return (long) ((num2 << 0x20) | num); }

I've highlighted the obvious defect in red (specifically num2 << 0x20). Obviously this method (when actually called) does work correctly; so the reported C# code is incorrect.

When looking at the actual IL, we have...

... L_005e: stloc.1 L_005f: ldloc.1 L_0060: conv.u8 L_0061: ldc.i4.s 0x20 L_0063: shl L_0064: ldloc.0 L_0065: conv.u8 L_0066: or L_0067: ret

...which indicates num2 and num on the return line should be cast to a ulong prior to any bit manipulation.

Ex: return (long)(((ulong)num2 << 0x20) | (ulong)num);

This corrected code actually does function correctly.

Is this something you folks can look into and deliver a fix for?

Sincerely,

John R. Nannenga

asked Feb 02 at 11:36

Mel's gravatar image

Mel
31


I've put it into our bug tracking system as RP-2462. We are currently quite close to releasing 7.5 so we won't be able to fix it for that version of the product. We will get back to regular EAP releases after 7.5 goes out.

answered Feb 03 at 09:28

Clive's gravatar image

Clive ♦♦
1.1k5

Your answer
toggle preview

Follow this question


By Email:

Once you sign in you will be able to subscribe for any updates here


By RSS:

Answers

Answers and Comments

Formatting your answer

  • *Italic*
  • **Bold**
  • ***Bold Italic***
  • Link: [text](http://url.com/ "title")
  • Paragraph: Two line breaks
  • Bulleted list: Paragraph then start line with *
  • Numbered list: Paragraph then start line with 1.
  • Blockquote: Paragraph then start with with >
  • Basic HTML tags are also supported

Asked: Feb 02 at 11:36

Seen: 213 times

Last updated: Feb 03 at 09:28

 

Tags:

×31
×3
×3