summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 8aa7466f5..bc07e8c39 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -5504,7 +5504,8 @@ execfuncdef(Estate state, Eprog redir_prog)
if (funcstack && funcstack->tp == FS_FUNC &&
!strcmp(s, funcstack->name)) {
Shfunc old = ((Shfunc)shfunctab->getnode(shfunctab, s));
- shf->node.flags |= old->node.flags & (PM_TAGGED|PM_TAGGED_LOCAL);
+ if (old)
+ shf->node.flags |= old->node.flags & (PM_TAGGED|PM_TAGGED_LOCAL);
}
shfunctab->addnode(shfunctab, ztrdup(s), shf);
}