From 20d4287eaf99560918dedbe2524b0cbbaef92625 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 15 Aug 2020 20:13:33 +0430 Subject: [PATCH] Shell: Fix outdated debug log code --- Shell/Shell.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index d4667c236c..a1aaed521b 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -646,13 +646,14 @@ NonnullRefPtrVector Shell::run_commands(Vector& commands) for (auto& arg : command.argv) dbg() << "argv: " << arg; for (auto& redir : command.redirections) { - if (redir->is_path_redirection()) { - auto path_redir = (const AST::PathRedirection*)redir.ptr(); + if (redir.is_path_redirection()) { + auto path_redir = (const AST::PathRedirection*)&redir; dbg() << "redir path " << (int)path_redir->direction << " " << path_redir->path << " <-> " << path_redir->fd; - } else if (redir->is_fd_redirection()) { - dbg() << "redir fd " << redir->source_fd << " -> " << redir->dest_fd; - } else if (redir->is_close_redirection()) { - auto close_redir = (const AST::CloseRedirection*)redir.ptr(); + } else if (redir.is_fd_redirection()) { + auto* fdredir = (const AST::FdRedirection*)&redir; + dbg() << "redir fd " << fdredir->source_fd << " -> " << fdredir->dest_fd; + } else if (redir.is_close_redirection()) { + auto close_redir = (const AST::CloseRedirection*)&redir; dbg() << "close fd " << close_redir->fd; } else { ASSERT_NOT_REACHED();