summaryrefslogtreecommitdiff
path: root/src/arch-mips64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch-mips64.c')
-rw-r--r--src/arch-mips64.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch-mips64.c b/src/arch-mips64.c
index 9707d1c..342d0d8 100644
--- a/src/arch-mips64.c
+++ b/src/arch-mips64.c
@@ -41,8 +41,9 @@ int mips64_syscall_resolve_name_munge(const char *name)
{
int sys;
+ /* NOTE: we don't want to modify the pseudo-syscall numbers */
sys = mips64_syscall_resolve_name(name);
- if (sys == __NR_SCMP_ERROR)
+ if (sys == __NR_SCMP_ERROR || sys < 0)
return sys;
return sys + __SCMP_NR_BASE;
@@ -59,7 +60,10 @@ int mips64_syscall_resolve_name_munge(const char *name)
*/
const char *mips64_syscall_resolve_num_munge(int num)
{
- return mips64_syscall_resolve_num(num - __SCMP_NR_BASE);
+ /* NOTE: we don't want to modify the pseudo-syscall numbers */
+ if (num >= __SCMP_NR_BASE)
+ num -= __SCMP_NR_BASE;
+ return mips64_syscall_resolve_num(num);
}
const struct arch_def arch_def_mips64 = {