Skip to content

Commit 086cda2

Browse files
committed
Remove old EH count code
1 parent c8b150f commit 086cda2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/DotNet/Emit/MethodBodyReader.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,9 @@ void ReadExceptionHandlers(out uint totalBodySize) {
478478
totalBodySize = 0;
479479
}
480480

481-
static ushort GetNumberOfExceptionHandlers(uint num) {
482-
// The CLR truncates the count so num handlers is always <= FFFFh.
483-
return (ushort)num;
484-
}
485-
486481
void ReadFatExceptionHandlers(ref DataReader ehReader) {
487482
ehReader.Position--;
488-
int num = GetNumberOfExceptionHandlers((ehReader.ReadUInt32() >> 8) / 24);
483+
int num = (int)((ehReader.ReadUInt32() >> 8) / 24);
489484
for (int i = 0; i < num; i++) {
490485
var eh = new ExceptionHandler((ExceptionHandlerType)ehReader.ReadUInt32());
491486
uint offs = ehReader.ReadUInt32();
@@ -505,7 +500,7 @@ void ReadFatExceptionHandlers(ref DataReader ehReader) {
505500
}
506501

507502
void ReadSmallExceptionHandlers(ref DataReader ehReader) {
508-
int num = GetNumberOfExceptionHandlers((uint)ehReader.ReadByte() / 12);
503+
int num = (int)((uint)ehReader.ReadByte() / 12);
509504
ehReader.Position += 2;
510505
for (int i = 0; i < num; i++) {
511506
var eh = new ExceptionHandler((ExceptionHandlerType)ehReader.ReadUInt16());

0 commit comments

Comments
 (0)