-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Using a process of elimination I've identified ${.sh.level} (SH_LEVELNOD) as the cause of the crash. This node apparently cannot be copied or moved without destabilising the shell. It contains the current depth of function calls and it cannot be changed by assignment, so this is not actually a problem. Meanwhile, this commit re-fixes it for the other three. src/cmd/ksh93/sh/subshell.c: - Simplify sh_assignok() by removing special-casing for L_ARGNOD, SH_SUBSCRNOD and SH_NAMENOD. 'add' now has 3 modes (0, 1, 2). - The test for a ${ subshare; } was actually wrong. sp->subshare is a saved backup value. We must test shp->subshare. (re: a9de50b) src/cmd/ksh93/bltins/typeset.c: - setall(): Update the mode 3 sh_assignok() call. src/cmd/ksh93/tests/variables.sh: - Regress-test subshell leaks for all special variables except ${.sh.level}.
- Loading branch information
Showing
3 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters