core/linux/os.c
/* is_readable_without_exception checks to see that all bytes with addresses
 * from pc to pc+size-1 are readable and that reading from there won't
 * generate an exception. if 'from_os' is true, check what the os thinks
 * the prot bits are instead of using the all memory list.
 */
is_readable_without_exception checks to see that all bytes with addresses
from pc to pc+size-1 are readable and that reading from there won't
generate an exception. if 'from_os' is true, check what the os thinks
the prot bits are instead of using the all memory list.
is_readable_without_exception checks to see that all bytes with addresses from pc to pc + size - 1 are readable and that reading from there won ' t generate an exception . if ' from_os ' is true check what the os thinks the prot bits are instead of using the all memory list .
static bool
is_readable_without_exception_internal(const byte *pc, size_t size, bool query_os)
{
    uint prot;
    byte *check_pc = (byte *) ALIGN_BACKWARD(pc, PAGE_SIZE);
    if (size > ((byte *)POINTER_MAX - pc))
        size = (byte *)POINTER_MAX - pc;
    do {
        bool rc = query_os ?
            get_memory_info_from_os(check_pc, NULL, NULL, &prot) :
            get_memory_info(check_pc, NULL, NULL, &prot);
        if (!rc || !TESTANY(MEMPROT_READ|MEMPROT_EXEC, prot))
            return false;
        check_pc += PAGE_SIZE;
    } while (check_pc != 0 && check_pc < pc+size);
    return true;
}
static bool is_readable_without_exception_internal ( const byte * pc , size_t size , bool query_os ) { uint prot ; byte * check_pc = ( byte * ) ALIGN_BACKWARD ( pc , PAGE_SIZE ) ; if ( size > ( ( byte * ) POINTER_MAX - pc ) ) size = ( byte * ) POINTER_MAX - pc ; do { bool rc = query_os ? get_memory_info_from_os ( check_pc , NULL , NULL , & prot ) : get_memory_info ( check_pc , NULL , NULL , & prot ) ; if ( ! rc || ! TESTANY ( MEMPROT_READ | MEMPROT_EXEC , prot ) ) return false ; check_pc += PAGE_SIZE ; } while ( check_pc != 0 && check_pc < pc + size ) ; return true ; }
is_readable_without_exception checks to see that all bytes with addresses
 from pc to pc+size-1 are readable and that reading from there won't
 generate an exception.
is_readable_without_exception checks to see that all bytes with addresses from pc to pc + size - 1 are readable and that reading from there won ' t generate an exception .
/*overflow*/