summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
Diffstat (limited to 'lang')
-rw-r--r--lang/c/pseudoc.cpp9
-rw-r--r--lang/rust/pseudorust.cpp10
2 files changed, 19 insertions, 0 deletions
diff --git a/lang/c/pseudoc.cpp b/lang/c/pseudoc.cpp
index b91b8e71..296c2d6a 100644
--- a/lang/c/pseudoc.cpp
+++ b/lang/c/pseudoc.cpp
@@ -1618,6 +1618,15 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
tokens.Append(OperationToken, "&");
}
}
+ else if ((!settings || settings->IsOptionSet(ShowTypeCasts)) && srcExpr.operation == HLIL_VAR)
+ {
+ if (srcExpr.GetType() && srcExpr.GetType()->GetClass() != StructureTypeClass && srcExpr.size > instr.size)
+ {
+ tokens.AppendOpenParen();
+ AppendSizeToken(instr.size, false, tokens);
+ tokens.AppendCloseParen();
+ }
+ }
GetExprTextInternal(srcExpr, tokens, settings, MemberAndFunctionOperatorPrecedence);
}
diff --git a/lang/rust/pseudorust.cpp b/lang/rust/pseudorust.cpp
index 80858658..380be7c6 100644
--- a/lang/rust/pseudorust.cpp
+++ b/lang/rust/pseudorust.cpp
@@ -1689,6 +1689,16 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe
castedSrcExpr = true;
}
}
+ else if ((!settings || settings->IsOptionSet(ShowTypeCasts)) && srcExpr.operation == HLIL_VAR)
+ {
+ if (srcExpr.GetType() && srcExpr.GetType()->GetClass() != StructureTypeClass && srcExpr.size > instr.size)
+ {
+ GetExprText(srcExpr, tokens, settings, MemberAndFunctionOperatorPrecedence);
+ tokens.Append(KeywordToken, " as ");
+ AppendSizeToken(instr.size, false, tokens);
+ castedSrcExpr = true;
+ }
+ }
if (!castedSrcExpr)
GetExprText(srcExpr, tokens, settings, MemberAndFunctionOperatorPrecedence);