Commit c3b82c7
committed
armv8m: Don't allow signed integer overflow
To avoid undefined behavior, replace the signed "times" counter with an unsigned one. We don't need to track negative times anyway.
./core/vmpu/src/mpu_armv8m/vmpu_armv8m_unpriv_access.c: In function 'vmpu_unpriv_access':
./core/vmpu/src/mpu_armv8m/vmpu_armv8m_unpriv_access.c:126:1: error: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Werror=strict-overflow]
}
^
./core/vmpu/src/mpu_armv8m/vmpu_armv8m_unpriv_access.c:94:10: error: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Werror=strict-overflow]
uint32_t vmpu_unpriv_access(uint32_t addr, uint32_t size, uint32_t data)1 parent aabaa47 commit c3b82c7
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
0 commit comments