Skip to content

Commit

Permalink
hal: add cpuGetId sanity check to satify gcc bounds checker
Browse files Browse the repository at this point in the history
JIRA: RTOS-927
  • Loading branch information
badochov committed Oct 11, 2024
1 parent 85a44b4 commit 5fd2a0b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hal/tlb/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ void hal_tlbInvalidateEntry(const pmap_t *pmap, const void *vaddr, size_t count)
size_t tasks_size;
spinlock_ctx_t sc;

if (id >= MAX_CPU_COUNT) {
/* Impossible make gcc array bound checker happy. */
return;
}

hal_spinlockSet(&tlb_common.tlbs[id].task_spinlock, &sc);
tasks_size = tlb_common.tlbs[id].tasks_size;

Expand Down

0 comments on commit 5fd2a0b

Please sign in to comment.