syscall.c: avoid infinite loop in subcalls parsing

clang complains about it, so it might be a good reason to refactor it
into something more linear.

* syscall.c (syscall_entering_decode): put syscall subcall decoding
before ipc/socket subcall decoding, remove loop.
This commit is contained in:
Eugene Syromyatnikov
2018-09-04 14:48:13 +02:00
parent f71663b233
commit 57a2b0fbdd

View File

@ -624,30 +624,23 @@ syscall_entering_decode(struct tcb *tcp)
return res;
}
# ifdef SYS_syscall_subcall
if (tcp->s_ent->sen == SEN_syscall)
decode_syscall_subcall(tcp);
# endif
#if defined SYS_ipc_subcall \
|| defined SYS_socket_subcall \
|| defined SYS_syscall_subcall
for (;;) {
switch (tcp->s_ent->sen) {
|| defined SYS_socket_subcall
switch (tcp->s_ent->sen) {
# ifdef SYS_ipc_subcall
case SEN_ipc:
decode_ipc_subcall(tcp);
break;
case SEN_ipc:
decode_ipc_subcall(tcp);
break;
# endif
# ifdef SYS_socket_subcall
case SEN_socketcall:
decode_socket_subcall(tcp);
break;
# endif
# ifdef SYS_syscall_subcall
case SEN_syscall:
decode_syscall_subcall(tcp);
if (tcp->s_ent->sen != SEN_syscall)
continue;
break;
# endif
}
case SEN_socketcall:
decode_socket_subcall(tcp);
break;
# endif
}
#endif