summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/function.cpp b/function.cpp
index bacfbab0..c93a8329 100644
--- a/function.cpp
+++ b/function.cpp
@@ -769,7 +769,19 @@ Ref<HighLevelILFunction> Function::GetHighLevelILIfAvailable() const
Ref<LanguageRepresentationFunction> Function::GetLanguageRepresentation() const
{
- return new LanguageRepresentationFunction(BNGetFunctionLanguageRepresentation(m_object));
+ BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentation(m_object);
+ if (!function)
+ return nullptr;
+ return new LanguageRepresentationFunction(function);
+}
+
+
+Ref<LanguageRepresentationFunction> Function::GetLanguageRepresentationIfAvailable() const
+{
+ BNLanguageRepresentationFunction* function = BNGetFunctionLanguageRepresentationIfAvailable(m_object);
+ if (!function)
+ return nullptr;
+ return new LanguageRepresentationFunction(function);
}