Skip to content

Commit

Permalink
* PEAPI.cs (PEFile.GetNextSectStart): Handle the case when (tide %
Browse files Browse the repository at this point in the history
SectionAlignment) == 0 . Patch by Carlo Kok. Fixes bug #78182.

svn path=/branches/mono-1-1-13/mcs/; revision=61556
  • Loading branch information
radical committed Jun 8, 2006
1 parent 2a8415d commit ff83f47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mcs/class/PEAPI/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2006-06-07 Ankit Jain <jankit@novell.com>

* PEAPI.cs (PEFile.GetNextSectStart): Handle the case when (tide %
SectionAlignment) == 0 . Patch by Carlo Kok. Fixes bug #78182.

2006-06-01 Ankit Jain <jankit@novell.com>

* PEAPI.cs (PEFile.AddMethod): Add overload for return type as Param
Expand Down
6 changes: 4 additions & 2 deletions mcs/class/PEAPI/PEAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ internal MetaData GetMetaData()

private uint GetNextSectStart(uint rva, uint tide)
{
if (tide < SectionAlignment) return rva + SectionAlignment;
return rva + ((tide / SectionAlignment) + 1) * SectionAlignment;
uint c = tide / SectionAlignment;
if ((tide % SectionAlignment) != 0)
c++;
return rva + (c * SectionAlignment);
}

private void BuildTextSection()
Expand Down

0 comments on commit ff83f47

Please sign in to comment.