From 2745b48e1692c9575e02490df8a57d8b945851fa Mon Sep 17 00:00:00 2001 From: implicitfield <114500360+implicitfield@users.noreply.github.com> Date: Sat, 21 Oct 2023 22:21:49 +0400 Subject: [PATCH] Shell: Don't try to cast NonnullRefPtrs when priting debug output Fixes a regression from 8a48246e. --- Userland/Shell/Shell.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index fe1af01ccd..197f91d910 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -1042,17 +1042,17 @@ Vector> Shell::run_commands(Vector& commands) for (auto& command : commands) { if constexpr (SH_DEBUG) { dbgln("Command"); - for (auto& arg : command.argv) + for (auto const& arg : command.argv) dbgln("argv: {}", arg); - for (auto& redir : command.redirections) { + for (auto const& redir : command.redirections) { if (redir->is_path_redirection()) { - auto path_redir = (const AST::PathRedirection*)&redir; + auto path_redir = (const AST::PathRedirection*)redir.ptr(); dbgln("redir path '{}' <-({})-> {}", path_redir->path, (int)path_redir->direction, path_redir->fd); } else if (redir->is_fd_redirection()) { - auto* fdredir = (const AST::FdRedirection*)&redir; + auto* fdredir = (const AST::FdRedirection*)redir.ptr(); dbgln("redir fd {} -> {}", fdredir->old_fd, fdredir->new_fd); } else if (redir->is_close_redirection()) { - auto close_redir = (const AST::CloseRedirection*)&redir; + auto close_redir = (const AST::CloseRedirection*)redir.ptr(); dbgln("close fd {}", close_redir->fd); } else { VERIFY_NOT_REACHED();