Work towards getting function.h off of shared_ptr

This commit is contained in:
ridiculousfish
2012-05-17 19:37:46 -07:00
parent 977c585f8b
commit 86645b32e1
9 changed files with 40 additions and 44 deletions

View File

@@ -787,12 +787,13 @@ void exec( parser_t &parser, job_t *j )
*/
signal_unblock();
const wchar_t * orig_def = function_get_definition( p->argv0() );
wcstring orig_def;
function_get_definition( p->argv0(), &orig_def );
// function_get_named_arguments may trigger autoload, which deallocates the orig_def.
// We should make function_get_definition return a wcstring (but how to handle NULL...)
if (orig_def)
def = wcsdup(orig_def);
if (! orig_def.empty())
def = wcsdup(orig_def.c_str());
wcstring_list_t named_arguments = function_get_named_arguments( p->argv0() );
shadows = function_get_shadows( p->argv0() );