securing the call to SWIG_IsOK, which is a macro

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8131 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-30 01:14:24 +00:00
commit 7223672e09
10 changed files with 63 additions and 58 deletions

View file

@ -44,12 +44,14 @@
%define %implicit_frag(Type...) ,fragment=SWIG_Traits_frag(Type) %enddef
%define %implicit_code(Type...)
if (SWIG_IsOK(swig::asval<Type >(obj, 0))) {
Type _v;
int res = swig::asval<Type >(obj, &_v);
{
Type _v;
int res = swig::asval<Type >(obj, &_v);
if (SWIG_IsOK(res)) {
if (val) *val = %new_copy(_v, value_type);
return SWIG_AddNewMask(res);
}
}
%enddef
/* implicit */