summaryrefslogtreecommitdiff
path: root/lang/rust/pseudorust.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/rust/pseudorust.cpp')
-rw-r--r--lang/rust/pseudorust.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/lang/rust/pseudorust.cpp b/lang/rust/pseudorust.cpp
index 300297dc..e3f661fa 100644
--- a/lang/rust/pseudorust.cpp
+++ b/lang/rust/pseudorust.cpp
@@ -1371,9 +1371,9 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe
std::optional<string> assignUpdateOperator;
std::optional<HighLevelILInstruction> assignUpdateSource;
bool assignUpdateNegate = false;
- const auto isSplit = destExpr.operation == HLIL_SPLIT;
+ const auto destIsSplit = destExpr.operation == HLIL_SPLIT;
std::optional<bool> assignSignHint;
- if (isSplit)
+ if (destIsSplit)
{
const auto high = destExpr.GetHighExpr<HLIL_SPLIT>();
const auto low = destExpr.GetLowExpr<HLIL_SPLIT>();
@@ -1389,6 +1389,23 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe
tokens.NewLine();
GetExprText(low, tokens, settings, precedence);
}
+ else if (srcExpr.operation == HLIL_SPLIT)
+ {
+ const auto high = srcExpr.GetHighExpr<HLIL_SPLIT>();
+ const auto low = srcExpr.GetLowExpr<HLIL_SPLIT>();
+ GetExprText(destExpr, tokens, settings, precedence);
+ tokens.Append(OperationToken, " = ");
+ tokens.AppendOpenParen();
+ GetExprText(high, tokens, settings, precedence);
+ tokens.Append(OperationToken, " << ");
+ tokens.Append(IntegerToken, std::to_string(low.size * 8));
+ tokens.AppendCloseParen();
+ tokens.Append(OperationToken, " | ");
+ GetExprText(low, tokens, settings, precedence);
+ tokens.AppendSemicolon();
+ tokens.NewLine();
+ return;
+ }
else
{
// Check for assignment with an operator on the same variable as the destination
@@ -1515,7 +1532,7 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe
appearsDead = false;
}
- if (isSplit)
+ if (destIsSplit)
{
// const auto high = destExpr.GetHighExpr<HLIL_SPLIT>();
const auto low = destExpr.GetLowExpr<HLIL_SPLIT>();
@@ -1545,7 +1562,7 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe
GetExprText(srcExpr, tokens, settings, AssignmentOperatorPrecedence, InnerExpression, assignSignHint);
}
- if (isSplit)
+ if (destIsSplit)
tokens.AppendCloseParen();
if (appearsDead)