This commit is contained in:
Yoshi Askharoun
2025-09-21 21:25:29 -05:00
parent 2587985a9b
commit 92886feac7
2 changed files with 11 additions and 7 deletions
+5 -1
View File
@@ -83,9 +83,13 @@ partial class Decompiler
if (expr is ParenthesizedExpressionSyntax parenExpr) if (expr is ParenthesizedExpressionSyntax parenExpr)
expr = parenExpr.Expression; expr = parenExpr.Expression;
var lastStatement = blockStack.Peek().Statements[^1]; var statements = blockStack.Peek().Statements;
if (statements.Count > 0)
{
var lastStatement = statements[^1];
if (lastStatement.DescendantNodes().Any(n => n.IsEquivalentTo(expr))) if (lastStatement.DescendantNodes().Any(n => n.IsEquivalentTo(expr)))
break; break;
}
blockStack.Peek().Statements.Add(ExpressionStatement(expr)); blockStack.Peek().Statements.Add(ExpressionStatement(expr));
} }
+4 -4
View File
@@ -194,7 +194,7 @@ public partial class Decompiler
var typeFromStringSchema = _context.GetImportedType(instruction.Operands.ElementAt(0)); var typeFromStringSchema = _context.GetImportedType(instruction.Operands.ElementAt(0));
var fromString = _context.GetConstant(instruction.Operands.ElementAt(1)); var fromString = _context.GetConstant(instruction.Operands.ElementAt(1));
var fromStringObj = IrisObject.Create(fromString, typeFromStringSchema, _context); var fromStringObj = IrisObject.Create(fromString, typeFromStringSchema, _context, initType);
stack.Push(fromStringObj); stack.Push(fromStringObj);
break; break;
@@ -210,7 +210,7 @@ public partial class Decompiler
var target = stack.Pop(); var target = stack.Pop();
var xTarget = (XElement)ToXmlFriendlyObject(target); var xTarget = (XElement)ToXmlFriendlyObject(target);
PropertyAssignOnXElement(xTarget, propertyToInit, IrisObject.Create(newPropValue, propertyToInit.PropertyType, _context)); PropertyAssignOnXElement(xTarget, propertyToInit, IrisObject.Create(newPropValue, propertyToInit.PropertyType, _context, initType));
stack.Push(new IrisObject(xTarget, propertyToInit.Owner)); stack.Push(new IrisObject(xTarget, propertyToInit.Owner));
break; break;
@@ -225,7 +225,7 @@ public partial class Decompiler
.Type; .Type;
var targetInstance = (XElement)ToXmlFriendlyObject(stack.Peek()); var targetInstance = (XElement)ToXmlFriendlyObject(stack.Peek());
var dictValueObj = IrisObject.Create(dictValue, dictValueType, _context); var dictValueObj = IrisObject.Create(dictValue, dictValueType, _context, initType);
var targetDictPropertyIndex = (ushort)instruction.Operands.ElementAt(0).Value; var targetDictPropertyIndex = (ushort)instruction.Operands.ElementAt(0).Value;
if (targetDictPropertyIndex is ushort.MaxValue) if (targetDictPropertyIndex is ushort.MaxValue)
@@ -245,7 +245,7 @@ public partial class Decompiler
.Type; .Type;
} }
var valueToAddObj = IrisObject.Create(valueToAdd, valueToAddType, _context); var valueToAddObj = IrisObject.Create(valueToAdd, valueToAddType, _context, initType);
var targetInstance2 = (XElement)ToXmlFriendlyObject(stack.Peek()); var targetInstance2 = (XElement)ToXmlFriendlyObject(stack.Peek());