aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi_mp.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-11 17:02:38 -0400
committerJack Lloyd <[email protected]>2017-10-11 17:02:38 -0400
commite831b200214ec611c3bd98f3a2df78e04dfc3536 (patch)
treedaafa5c8171008b7556a59027229251248f3260a /src/lib/ffi/ffi_mp.cpp
parentfb3076f04336418d2daa5d278f2895d0174dedb9 (diff)
Simplify ffi call overhead
Notable reductions in code size, stack size and function call overhead.
Diffstat (limited to 'src/lib/ffi/ffi_mp.cpp')
-rw-r--r--src/lib/ffi/ffi_mp.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi_mp.cpp b/src/lib/ffi/ffi_mp.cpp
index 0b55c1d69..87e455ccd 100644
--- a/src/lib/ffi/ffi_mp.cpp
+++ b/src/lib/ffi/ffi_mp.cpp
@@ -20,7 +20,8 @@ using namespace Botan_FFI;
int botan_mp_init(botan_mp_t* mp_out)
{
return ffi_guard_thunk(BOTAN_CURRENT_FUNCTION, [=]() {
- BOTAN_ASSERT_ARG_NON_NULL(mp_out);
+ if(mp_out == nullptr)
+ return BOTAN_FFI_ERROR_NULL_POINTER;
*mp_out = new botan_mp_struct(new Botan::BigInt);
return BOTAN_FFI_SUCCESS;