diff options
| author | Galen Williamson <galen@vector35.com> | 2022-05-02 15:36:52 -0400 |
|---|---|---|
| committer | Galen Williamson <galen@vector35.com> | 2022-05-02 15:36:52 -0400 |
| commit | bbbe4d177c378077b43b09c74a3a20a09bfee443 (patch) | |
| tree | 0e40cedd86fce589c4e6a67742194a026d9e7752 /function.cpp | |
| parent | 8ed00c24795872a33eeb2fd3b00911ef0b45b269 (diff) | |
added API for GetLanguageRepresentationIfAvailable
Diffstat (limited to 'function.cpp')
| -rw-r--r-- | function.cpp | 14 |
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); } |
