From 6d4f2e37fe0bed3d96de0a3c9c9fa3cc6fc3337c Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 6 Sep 2012 19:01:57 +0200 Subject: [PATCH] Fix crash when decompiling WebSocketBase::SendFrameAsync. --- ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs b/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs index 58632fd96..b050353ab 100644 --- a/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs +++ b/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs @@ -303,7 +303,13 @@ namespace ICSharpCode.Decompiler.ILAst return v.Type; } case ILCode.Ldloca: - return new ByReferenceType(((ILVariable)expr.Operand).Type); + { + ILVariable v = (ILVariable)expr.Operand; + if (v.Type != null) + return new ByReferenceType(v.Type); + else + return null; + } #endregion #region Call / NewObj case ILCode.Call: