foss-for-synopsys-dwc-arc-processors/openocd

32 bit overflow ?

jurobystricky opened this issue · 1 comments

in the arc_mem.c "arc_mem_is_slow_memory", there is this assert:
assert(addr_end >= addr);
However, it will falsely trigger when checking the end of 32 bit space. For example if

addr=0xFFFFF000
size=4
count =1024

Then the assertion will trigger as then addr_end is evaluated as 0.

Yes, this check wasn't valid for this case. In fact the actual condition in this function wasn't correct for this case, because addr_end and CCM end will point to same address of arc_mem_is_slow_memory is called for the ending of CCM region. I've fixed that in master branch:
801cf93 arc: Fix invalid address range check
f6a2251 arc: Fix invalid assert in arc_mem_is_slow_memory

Thanks, for the report.