From ad05dd2072917e2487dcd34dbc249b2a0efac589 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Mon, 25 Jan 2016 15:16:43 -0500 Subject: Initial implementation of platform ABI classes --- type.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'type.cpp') diff --git a/type.cpp b/type.cpp index 45967c6c..5a48d590 100644 --- a/type.cpp +++ b/type.cpp @@ -60,9 +60,12 @@ Ref Type::GetChildType() const } -BNCallingConvention Type::GetCallingConvention() const +Ref Type::GetCallingConvention() const { - return BNGetTypeCallingConvention(m_type); + BNCallingConvention* cc = BNGetTypeCallingConvention(m_type); + if (cc) + return new CoreCallingConvention(cc); + return nullptr; } @@ -196,7 +199,7 @@ Ref Type::ArrayType(Type* type, uint64_t elem) } -Ref Type::FunctionType(Type* returnValue, BNCallingConvention callingConvention, +Ref Type::FunctionType(Type* returnValue, CallingConvention* callingConvention, const std::vector& params, bool varArg) { BNNameAndType* paramArray = new BNNameAndType[params.size()]; @@ -206,7 +209,8 @@ Ref Type::FunctionType(Type* returnValue, BNCallingConvention callingConve paramArray[i].type = params[i].type->GetTypeObject(); } - Type* type = new Type(BNCreateFunctionType(returnValue->GetTypeObject(), callingConvention, + Type* type = new Type(BNCreateFunctionType(returnValue->GetTypeObject(), + callingConvention ? callingConvention->GetCallingConventionObject() : nullptr, paramArray, params.size(), varArg)); delete[] paramArray; return type; -- cgit v1.3.1