On 3/3/26 5:07 PM, Farhan Ali wrote:
> 
> On 2/12/2026 12:43 PM, Zhuoying Cai wrote:
>> +static bool is_comp_overlap(SecureIplCompAddrRange *comp_addr_range,
>> +                            int addr_range_index,
>> +                            uint64_t start_addr, uint64_t end_addr)
>> +{
>> +    /* neither a signed nor an unsigned component can overlap with a signed 
>> component */
>> +    for (int i = 0; i < addr_range_index; i++) {
>> +        if ((comp_addr_range[i].start_addr < end_addr &&
>> +            start_addr < comp_addr_range[i].end_addr) &&
>> +            comp_addr_range[i].is_signed) {
>> +            return true;
>> +       }
>> +    }
>> +
>> +    return false;
>> +}
>> +
> 
> Shouldn't we use <= and >= checks? For example if 
> comp_addr_range[i].start_addr == end_addr, wouldn't that be an overlap? 
> and similar for start_addr?
>
> Thanks
> 
> Farhan
> 
>

Please correct me if I’m wrong. My understanding is that the component
address ranges are defined as half-open intervals [start_addr,
end_addr), where end_addr is exclusive. If that is the case, then the <
comparisons are correct — for example, [1, 3) and [3, 5) are adjacent
but not overlapping.






Reply via email to