diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-08-15 00:24:03 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-08-15 18:30:13 -0400 |
| commit | ec2d882e1a165b703e8fedaa81246dcdd91f50f3 (patch) | |
| tree | a6d9f2aebca1618db3aea5faf14ea6ddb60b7002 /type.cpp | |
| parent | 6bcb7bd30e5e6a8e69c875841f04245b8c3a0d7a (diff) | |
Add APIs to access and update portions of the function type, and added new APIs for global registers and implicit incoming state in calling conventions
Diffstat (limited to 'type.cpp')
| -rw-r--r-- | type.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -368,9 +368,10 @@ vector<NameAndType> Type::GetParameters() const } -bool Type::HasVariableArguments() const +Confidence<bool> Type::HasVariableArguments() const { - return BNTypeHasVariableArguments(m_object); + BNBoolWithConfidence result = BNTypeHasVariableArguments(m_object); + return Confidence<bool>(result.value, result.confidence); } @@ -655,7 +656,7 @@ Ref<Type> Type::ArrayType(const Confidence<Ref<Type>>& type, uint64_t elem) Ref<Type> Type::FunctionType(const Confidence<Ref<Type>>& returnValue, const Confidence<Ref<CallingConvention>>& callingConvention, - const std::vector<NameAndType>& params, bool varArg) + const std::vector<NameAndType>& params, const Confidence<bool>& varArg) { BNTypeWithConfidence returnValueConf; returnValueConf.type = returnValue->GetObject(); @@ -673,8 +674,12 @@ Ref<Type> Type::FunctionType(const Confidence<Ref<Type>>& returnValue, paramArray[i].typeConfidence = params[i].type.GetConfidence(); } + BNBoolWithConfidence varArgConf; + varArgConf.value = varArg.GetValue(); + varArgConf.confidence = varArg.GetConfidence(); + Type* type = new Type(BNCreateFunctionType(&returnValueConf, &callingConventionConf, - paramArray, params.size(), varArg)); + paramArray, params.size(), &varArgConf)); delete[] paramArray; return type; } @@ -685,7 +690,7 @@ void Type::SetFunctionCanReturn(const Confidence<bool>& canReturn) BNBoolWithConfidence bc; bc.value = canReturn.GetValue(); bc.confidence = canReturn.GetConfidence(); - BNSetFunctionCanReturn(m_object, &bc); + BNSetFunctionTypeCanReturn(m_object, &bc); } |
