diff options
| author | Ryan Snyder <ryan@vector35.com> | 2024-10-28 15:02:01 -0400 |
|---|---|---|
| committer | Ryan Snyder <ryan@vector35.com> | 2024-10-28 19:36:05 -0400 |
| commit | 717a2ea5c79a95dd3178447e27be979895f55892 (patch) | |
| tree | b900a836bb18087aae5d50968ea4a2671b60bbd9 /lang | |
| parent | c0e99630986903c6988b7fdbf4f69a3389c71d76 (diff) | |
hlr: expose ability to claim line addresses
Diffstat (limited to 'lang')
| -rw-r--r-- | lang/c/pseudoc.cpp | 5 | ||||
| -rw-r--r-- | lang/rust/pseudorust.cpp | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lang/c/pseudoc.cpp b/lang/c/pseudoc.cpp index 8de510a7..4f2174d6 100644 --- a/lang/c/pseudoc.cpp +++ b/lang/c/pseudoc.cpp @@ -681,6 +681,11 @@ void PseudoCFunction::GetExprTextInternal(const HighLevelILInstruction& instr, H auto function = m_highLevelIL->GetFunction(); if (instr.ast) tokens.PrependCollapseIndicator(function, instr); + + // ensure we claim the line address for top level instrs on a line + if (instr.operation != HLIL_BLOCK) + tokens.InitLine(); + switch (instr.operation) { case HLIL_BLOCK: diff --git a/lang/rust/pseudorust.cpp b/lang/rust/pseudorust.cpp index d7e18efc..0f41678f 100644 --- a/lang/rust/pseudorust.cpp +++ b/lang/rust/pseudorust.cpp @@ -716,6 +716,8 @@ void PseudoRustFunction::GetExprText(const HighLevelILInstruction& instr, HighLe auto function = m_highLevelIL->GetFunction(); if (instr.ast) tokens.PrependCollapseIndicator(function, instr); + if (instr.operation != HLIL_BLOCK) + tokens.InitLine(); switch (instr.operation) { case HLIL_BLOCK: |
