From 5895192a03681687bbb02aeecd2e0504ef0c7ff8 Mon Sep 17 00:00:00 2001 From: Steven Massey Date: Wed, 2 Jun 2021 09:20:18 -0700 Subject: [PATCH] no message --- source/extensions/m3_extensions.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/extensions/m3_extensions.c b/source/extensions/m3_extensions.c index df632cb..c0edfd9 100644 --- a/source/extensions/m3_extensions.c +++ b/source/extensions/m3_extensions.c @@ -61,8 +61,13 @@ M3Result m3Ext_InjectFunction (IM3Module i_module, { M3Result result = m3Err_none; d_m3Assert (io_functionIndex); + IM3FuncType ftype = NULL; + + _try { + if (not i_module) + _throw (m3Err_nullArgument); + IM3Function function = NULL; - IM3FuncType ftype = NULL; _ (SignatureToFuncType (& ftype, i_signature)); i32 index = * io_functionIndex; @@ -125,7 +130,7 @@ _ (Module_AddFunction (i_module, funcTypeIndex, NULL)); _ (CompileFunction (function)); - _catch: + } _catch: m3_Free (ftype); return result;