Преглед изворни кода

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

svn path=/trunk/mcs/; revision=61555

Ankit Jain пре 19 година
родитељ
комит
7669023479
2 измењених фајлова са 9 додато и 2 уклоњено
  1. 5 0
      mcs/class/PEAPI/ChangeLog
  2. 4 2
      mcs/class/PEAPI/PEAPI.cs

+ 5 - 0
mcs/class/PEAPI/ChangeLog

@@ -1,3 +1,8 @@
+2006-06-07  Ankit Jain  <[email protected]>
+
+	* PEAPI.cs (PEFile.GetNextSectStart): Handle the case when (tide %
+	SectionAlignment) == 0 . Patch by Carlo Kok. Fixes bug #78182.
+
 2006-06-01  Ankit Jain  <[email protected]>
 
 	* PEAPI.cs (PEFile.AddMethod): Add overload for return type as Param

+ 4 - 2
mcs/class/PEAPI/PEAPI.cs

@@ -162,8 +162,10 @@ namespace PEAPI {
 
 		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()