diff options
| author | 2023-10-25 14:25:05 +0100 | |
|---|---|---|
| committer | 2023-11-29 13:19:42 +0000 | |
| commit | 82c93a5ea38f57fdc977b1d88c2b964fa84c7f7c (patch) | |
| tree | a85a084dddbd5c1c362264546c57485f149c7acb /compiler/optimizing/code_sinking.h | |
| parent | 1732c29de19c872badec821053de652f6f7a846f (diff) | |
Make periodic loop optimization safe from overflow
The trip number is calculated by doing:
    ((end - start) + (step - 1)) / step
(Note that we add step - 1 as a way of doing ceiling).
This way of calculating can overflow and produce the wrong result
if e.g. end and start are in opposite sides of the spectrum.
We can add checks to make sure that the calculation doesn't overflow.
Bug: 256858062
Fixes: 256858062
Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing
Change-Id: Ib2868406d2aa8f106dab06c0b44ef1b6208ef41a
Diffstat (limited to 'compiler/optimizing/code_sinking.h')
0 files changed, 0 insertions, 0 deletions