On 10/25/22 06:43, Helge Deller wrote:
+ abi_long maxfd = arg2; + + if ((sizeof(abi_long) == 4 && arg2 == (abi_long)0x7FFFFFFFUL) || + (sizeof(abi_long) == 8 && arg2 == (abi_long)0x7FFFFFFFFFFFFFFFULL)) { + maxfd = target_fd_max; + } + + for (fd = arg1; fd < maxfd; fd++) {
Why do we need explicit checks for INT32/64_MAX? If the guest passes 0x7FFFFFFFFFFFFFFEULL, do we really need to iterate over all of those impossible values?
I should think some expression involving MIN() is in order. r~