From 8740385f9ed2c5953e204b124ce6099c45d6d76f Mon Sep 17 00:00:00 2001 From: Nicholas Mosier Date: Thu, 7 Sep 2023 14:17:32 -0700 Subject: [PATCH] sim-se: Fix tgkill logic bug in handling signal argument The syscall emulation of tgkill contained a simple logic bug (a `||` instead of a `&&`), causing the signal argument to always be considered invalid. This patch fixes the bug by simply changing the `||` to a `&&`. GitHub issue: https://github.com/gem5/gem5/issues/284 Change-Id: I3b02c618c369ef56d32a0b04e0b13eacc9fb4977 --- src/sim/syscall_emul.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index b4550dd86b..8e6fde3714 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -2409,7 +2409,7 @@ tgkillFunc(SyscallDesc *desc, ThreadContext *tc, int tgid, int tid, int sig) } } - if (sig != 0 || sig != OS::TGT_SIGABRT) + if (sig != 0 && sig != OS::TGT_SIGABRT) return -EINVAL; if (tgt_proc == nullptr)