From ca6a283b1619e290215ad58dcc183a2562afe61e Mon Sep 17 00:00:00 2001 From: Pent Ploompuu Date: Tue, 7 Jun 2011 04:56:36 +0300 Subject: [PATCH] Fixed variable splitting --- ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs index a62cfdc34..262cef239 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs @@ -564,12 +564,12 @@ namespace ICSharpCode.Decompiler.ILAst // Add loads to the data structure; merge variables if necessary foreach(ByteCode load in loads) { ByteCode[] storedBy = load.VariablesBefore[variableIndex].StoredBy; - if (storedBy.Length == 0) { + if (storedBy.Length == 0 || storedBy[0] == load) { // Load which always loads the default ('uninitialized') value // Create a dummy variable just for this load newVars.Add(new VariableInfo() { Variable = new ILVariable() { - Name = "var_" + variableIndex + "_" + load.Offset.ToString("X2") + "_default", + Name = "var_" + variableIndex + "_" + load.Offset.ToString("X2") + (storedBy.Length == 0 ? "_default" : null), Type = varType, OriginalVariable = methodDef.Body.Variables[variableIndex] },