From 231afab8b0ba6c8c9eff879681c52724b6688c18 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 3 Dec 2018 22:20:28 -0500 Subject: Commonize all InstructionTextToken generation --- lowlevelil.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lowlevelil.cpp') 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, vectorGetObject(), 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; } -- cgit v1.3.1