summaryrefslogtreecommitdiff
path: root/lowlevelil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lowlevelil.cpp')
-rw-r--r--lowlevelil.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/lowlevelil.cpp b/lowlevelil.cpp
index 3e09e085..f710e08f 100644
--- a/lowlevelil.cpp
+++ b/lowlevelil.cpp
@@ -433,13 +433,7 @@ bool LowLevelILFunction::GetExprText(Architecture* arch, ExprId expr, vector<Ins
if (!BNGetLowLevelILExprText(m_object, arch->GetObject(), expr, &list, &count))
return false;
- tokens.clear();
- tokens.reserve(count);
- for (size_t i = 0; i < count; i++)
- tokens.emplace_back(list[i].type, list[i].context, list[i].text, list[i].address, list[i].value, list[i].size,
- list[i].operand, list[i].confidence);
-
- BNFreeInstructionText(list, count);
+ tokens = InstructionTextToken::ConvertAndFreeInstructionTextTokenList(list, count);
return true;
}
@@ -453,13 +447,7 @@ bool LowLevelILFunction::GetInstructionText(Function* func, Architecture* arch,
instr, &list, &count))
return false;
- tokens.clear();
- tokens.reserve(count);
- for (size_t i = 0; i < count; i++)
- tokens.emplace_back(list[i].type, list[i].context, list[i].text, list[i].address, list[i].value, list[i].size,
- list[i].operand, list[i].confidence);
-
- BNFreeInstructionText(list, count);
+ tokens = InstructionTextToken::ConvertAndFreeInstructionTextTokenList(list, count);
return true;
}