summaryrefslogtreecommitdiff
path: root/src/arch-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch-mips.c')
-rw-r--r--src/arch-mips.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch-mips.c b/src/arch-mips.c
index f0e6a14..06741c7 100644
--- a/src/arch-mips.c
+++ b/src/arch-mips.c
@@ -43,8 +43,9 @@ int mips_syscall_resolve_name_munge(const char *name)
{
int sys;
+ /* NOTE: we don't want to modify the pseudo-syscall numbers */
sys = mips_syscall_resolve_name(name);
- if (sys == __NR_SCMP_ERROR)
+ if (sys == __NR_SCMP_ERROR || sys < 0)
return sys;
return sys + __SCMP_NR_BASE;
@@ -61,7 +62,10 @@ int mips_syscall_resolve_name_munge(const char *name)
*/
const char *mips_syscall_resolve_num_munge(int num)
{
- return mips_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 mips_syscall_resolve_num(num);
}
const struct arch_def arch_def_mips = {