Revert "Refactor to avoid nonnull checks on "this" pointer."

This reverts commit 0008bdea02.

This patch introduced a regression.  Calling FOO=$(...) in zsh hangs
indefinitely and has to be killed forcefully.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-04-05 10:26:06 +02:00
parent 722e363c4d
commit 41abcc5825
9 changed files with 38 additions and 75 deletions

View File

@@ -514,7 +514,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags)
bool __reg1
_pinfo::exists ()
{
return process_state && !(process_state & (PID_EXITED | PID_REAPED | PID_EXECED));
return this && process_state && !(process_state & (PID_EXITED | PID_REAPED | PID_EXECED));
}
bool
@@ -685,7 +685,7 @@ _pinfo::commune_request (__uint32_t code, ...)
res.s = NULL;
res.n = 0;
if (!pid)
if (!this || !pid)
{
set_errno (ESRCH);
goto err;
@@ -783,7 +783,7 @@ out:
fhandler_pipe *
_pinfo::pipe_fhandler (int64_t unique_id, size_t &n)
{
if (!pid)
if (!this || !pid)
return NULL;
if (pid == myself->pid)
return NULL;
@@ -796,7 +796,7 @@ char *
_pinfo::fd (int fd, size_t &n)
{
char *s;
if (!pid)
if (!this || !pid)
return NULL;
if (pid != myself->pid)
{
@@ -820,7 +820,7 @@ char *
_pinfo::fds (size_t &n)
{
char *s;
if (!pid)
if (!this || !pid)
return NULL;
if (pid != myself->pid)
{
@@ -848,7 +848,7 @@ char *
_pinfo::root (size_t& n)
{
char *s;
if (!pid)
if (!this || !pid)
return NULL;
if (pid != myself->pid && !ISSTATE (this, PID_NOTCYGWIN))
{
@@ -893,7 +893,7 @@ char *
_pinfo::cwd (size_t& n)
{
char *s = NULL;
if (!pid)
if (!this || !pid)
return NULL;
if (ISSTATE (this, PID_NOTCYGWIN))
{
@@ -939,7 +939,7 @@ char *
_pinfo::cmdline (size_t& n)
{
char *s = NULL;
if (!pid)
if (!this || !pid)
return NULL;
if (ISSTATE (this, PID_NOTCYGWIN))
{