Skip to content

Commit 0400467

Browse files
committed
Fix pseudo C and rust type cast on HLIL_DEREF
Should be using the instruction size of the HLIL_DEREF instruction, not the size of the HLIL_DEREF's source expression
1 parent 7769c88 commit 0400467

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lang/c/pseudoc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H
16141614
const auto constant = srcExpr.GetConstant<HLIL_CONST_PTR>();
16151615

16161616
vector<InstructionTextToken> pointerTokens{};
1617-
if (AppendPointerTextToken(srcExpr, constant, pointerTokens, settings, DereferenceNonDataSymbols, precedence) == DataSymbolResult)
1617+
if (AppendPointerTextToken(instr, constant, pointerTokens, settings, DereferenceNonDataSymbols, precedence) == DataSymbolResult)
16181618
{
16191619
const auto type = srcExpr.GetType();
16201620
if (type && type->GetClass() == PointerTypeClass && instr.size != type->GetChildType()->GetWidth())

lang/rust/pseudorust.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe
16861686
srcPrecedence = LowUnaryOperatorPrecedence;
16871687

16881688
vector<InstructionTextToken> pointerTokens{};
1689-
if (AppendPointerTextToken(srcExpr, constant, pointerTokens, settings, DereferenceNonDataSymbols, srcPrecedence) == DataSymbolResult)
1689+
if (AppendPointerTextToken(instr, constant, pointerTokens, settings, DereferenceNonDataSymbols, srcPrecedence) == DataSymbolResult)
16901690
{
16911691
if (type && type->GetClass() == PointerTypeClass && instr.size != type->GetChildType()->GetWidth())
16921692
{

0 commit comments

Comments
 (0)