bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Functions that update themselves


From: konsolebox
Subject: Re: Functions that update themselves
Date: Mon, 3 Jun 2019 22:46:54 +0800

On Mon, Jun 3, 2019 at 9:26 PM Chet Ramey <chet.ramey@case.edu> wrote:
> It's not disallowed. Since a function definition is a compound command,
> and all functions are global, I don't see why it shouldn't.

What I worry about is the way an executable part of the function can
be freed while the function is being redefined or unset that it may
cause faults because the code is still being executed.  Bash doesn't
document its strategy for freeing up function code so whether it's
safe or not is currently ambiguous.  Perhaps having one last line of
code to execute after a function is redefined is currently safe, but
it would be nice if it gets affirmed that it's intended to be.

-- 
konsolebox



reply via email to

[Prev in Thread] Current Thread [Next in Thread]