A couple of R2RDump fixes (#44558)
authorAndrew Au <andrewau@microsoft.com>
Thu, 12 Nov 2020 01:39:29 +0000 (17:39 -0800)
committerGitHub <noreply@github.com>
Thu, 12 Nov 2020 01:39:29 +0000 (17:39 -0800)
src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs
src/coreclr/src/tools/r2rdump/TextDumper.cs

index 6c6b2f0..938103f 100644 (file)
@@ -1669,6 +1669,14 @@ namespace ILCompiler.Reflection.ReadyToRun
                     builder.Append("NEW_MULTI_DIM_ARR__NON_VAR_ARG");
                     break;
 
+                case ReadyToRunHelper.MonitorEnter:
+                    builder.Append("MONITOR_ENTER");
+                    break;
+
+                case ReadyToRunHelper.MonitorExit:
+                    builder.Append("MONITOR_EXIT");
+                    break;
+
                 // Helpers used with generic handle lookup cases
                 case ReadyToRunHelper.NewObject:
                     builder.Append("NEW_OBJECT");
@@ -1879,9 +1887,7 @@ namespace ILCompiler.Reflection.ReadyToRun
                     break;
 
                 default:
-                    // TODO: Something is wrong with helper signature parsing
-                    builder.Append(string.Format("Unknown helper: {0:X2}", helperType));
-                    break;
+                    throw new BadImageFormatException();
             }
         }
 
index 682abd7..ea60e1d 100644 (file)
@@ -226,9 +226,8 @@ namespace R2RDump
                     }
                     _writer.WriteLine();
                 }
-
                 BaseGcInfo gcInfo = (_options.HideTransitions ? null : rtf.Method?.GcInfo);
-                if (gcInfo != null && gcInfo.Transitions.TryGetValue(codeOffset, out List<BaseGcTransition> transitionsForOffset))
+                if (gcInfo != null && gcInfo.Transitions != null && gcInfo.Transitions.TryGetValue(codeOffset, out List<BaseGcTransition> transitionsForOffset))
                 {
                     string[] formattedTransitions = new string[transitionsForOffset.Count];
                     for (int transitionIndex = 0; transitionIndex < formattedTransitions.Length; transitionIndex++)