diff --git a/libpromises/fncall.c b/libpromises/fncall.c index 3056d58132..8982ccca46 100644 --- a/libpromises/fncall.c +++ b/libpromises/fncall.c @@ -68,6 +68,8 @@ Rlist *NewExpArgs(EvalContext *ctx, const Policy *policy, const FnCall *fp, cons return RlistCopy(fp->args); } + assert(fp != NULL); + const FnCallType *fn = FnCallTypeGet(fp->name); if (fn == NULL) { @@ -101,7 +103,9 @@ Rlist *NewExpArgs(EvalContext *ctx, const Policy *policy, const FnCall *fp, cons } else { - rval = ExpandPrivateRval(ctx, NULL, NULL, rp->val.item, rp->val.type); + const Bundle *caller_bundle = fp->caller ? PromiseGetBundle(fp->caller) : NULL; + const char *caller_ns = caller_bundle ? caller_bundle->ns : NULL; + rval = ExpandPrivateRval(ctx, caller_ns, NULL, rp->val.item, rp->val.type); assert(rval.item); }