Skip to content
Snippets Groups Projects
Commit b7e69fcb authored by Wim Lavrijsen's avatar Wim Lavrijsen
Browse files

protection to not crash on return-by-value (not yet supported by Cling)

git-svn-id: http://root.cern.ch/svn/root/trunk@46819 27541ba8-7e3a-0410-8455-c3a389f83636
parent 720e4e08
No related branches found
No related tags found
No related merge requests found
......@@ -200,6 +200,10 @@ PYROOT_IMPLEMENT_ARRAY_EXECUTOR( Double, Double_t )
//- special cases ------------------------------------------------------------
PyObject* PyROOT::TSTLStringExecutor::Execute( CallFunc_t* func, void* self )
{
// TODO: Cling can not handle return by value for now
PyErr_SetString(PyExc_NotImplementedError, "CLING DOES NOT SUPPORT RETURN BY VALUE!" );
return 0;
// execute <func> with argument <self>, construct python string return value
std::string* result = (std::string*)gInterpreter->CallFunc_ExecInt( func, self );
if ( ! result ) {
......@@ -234,6 +238,10 @@ PyObject* PyROOT::TRootObjectExecutor::Execute( CallFunc_t* func, void* self )
//____________________________________________________________________________
PyObject* PyROOT::TRootObjectByValueExecutor::Execute( CallFunc_t* func, void* self )
{
// TODO: Cling can not handle return by value for now
PyErr_SetString(PyExc_NotImplementedError, "CLING DOES NOT SUPPORT RETURN BY VALUE!" );
return 0;
// execution will bring a temporary in existence
void* result = (void*)gInterpreter->CallFunc_ExecInt( func, self );
if ( ! result ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment