diff options
| author | Brandon Miller <brandon@vector35.com> | 2025-04-11 08:12:29 -0400 |
|---|---|---|
| committer | Brandon Miller <brandon@vector35.com> | 2025-04-11 08:13:56 -0400 |
| commit | 04004676ca4207fc40067cae298077d74cb01cc9 (patch) | |
| tree | f244e0dd4255a72c12c67c12562c57399655e1ad | |
| parent | 7769c88e8f72b2a0ca01b7f1fa7d8a8c69a6010e (diff) | |
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
| -rw-r--r-- | lang/c/pseudoc.cpp | 2 | ||||
| -rw-r--r-- | lang/rust/pseudorust.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lang/c/pseudoc.cpp b/lang/c/pseudoc.cpp index 52622f57..ac1fe3bb 100644 --- a/lang/c/pseudoc.cpp +++ b/lang/c/pseudoc.cpp @@ -1614,7 +1614,7 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H const auto constant = srcExpr.GetConstant<HLIL_CONST_PTR>(); vector<InstructionTextToken> pointerTokens{}; - if (AppendPointerTextToken(srcExpr, constant, pointerTokens, settings, DereferenceNonDataSymbols, precedence) == DataSymbolResult) + if (AppendPointerTextToken(instr, constant, pointerTokens, settings, DereferenceNonDataSymbols, precedence) == DataSymbolResult) { const auto type = srcExpr.GetType(); if (type && type->GetClass() == PointerTypeClass && instr.size != type->GetChildType()->GetWidth()) diff --git a/lang/rust/pseudorust.cpp b/lang/rust/pseudorust.cpp index a1f7defe..300297dc 100644 --- a/lang/rust/pseudorust.cpp +++ b/lang/rust/pseudorust.cpp @@ -1686,7 +1686,7 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe srcPrecedence = LowUnaryOperatorPrecedence; vector<InstructionTextToken> pointerTokens{}; - if (AppendPointerTextToken(srcExpr, constant, pointerTokens, settings, DereferenceNonDataSymbols, srcPrecedence) == DataSymbolResult) + if (AppendPointerTextToken(instr, constant, pointerTokens, settings, DereferenceNonDataSymbols, srcPrecedence) == DataSymbolResult) { if (type && type->GetClass() == PointerTypeClass && instr.size != type->GetChildType()->GetWidth()) { |
