summaryrefslogtreecommitdiff
path: root/lang/c/pseudoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/c/pseudoc.cpp')
-rw-r--r--lang/c/pseudoc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lang/c/pseudoc.cpp b/lang/c/pseudoc.cpp
index 8ab07a75..b91b8e71 100644
--- a/lang/c/pseudoc.cpp
+++ b/lang/c/pseudoc.cpp
@@ -1604,6 +1604,21 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
}
else
{
+ if ((!settings || settings->IsOptionSet(ShowTypeCasts)) && srcExpr.operation == HLIL_ARRAY_INDEX)
+ {
+ auto arrayIndexExpr = srcExpr.GetSourceExpr<HLIL_ARRAY_INDEX>();
+ if (arrayIndexExpr.operation == HLIL_VAR &&
+ arrayIndexExpr.GetType()->GetChildType()->GetWidth() < instr.size)
+ {
+ tokens.Append(TextToken, "*");
+ tokens.AppendOpenParen();
+ AppendSizeToken(instr.size, false, tokens);
+ tokens.Append(TextToken, "*");
+ tokens.AppendCloseParen();
+ tokens.Append(OperationToken, "&");
+ }
+ }
+
GetExprTextInternal(srcExpr, tokens, settings, MemberAndFunctionOperatorPrecedence);
}