From bbbe4d177c378077b43b09c74a3a20a09bfee443 Mon Sep 17 00:00:00 2001 From: Galen Williamson Date: Mon, 2 May 2022 15:36:52 -0400 Subject: added API for GetLanguageRepresentationIfAvailable --- function.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index bacfbab0..c93a8329 100644 --- a/function.cpp +++ b/function.cpp @@ -769,7 +769,19 @@ Ref Function::GetHighLevelILIfAvailable() const Ref Function::GetLanguageRepresentation() const { - return new LanguageRepresentationFunction(BNGetFunctionLanguageRepresentation(m_object)); + BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentation(m_object); + if (!function) + return nullptr; + return new LanguageRepresentationFunction(function); +} + + +Ref Function::GetLanguageRepresentationIfAvailable() const +{ + BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentationIfAvailable(m_object); + if (!function) + return nullptr; + return new LanguageRepresentationFunction(function); } -- cgit v1.3.1