-
Tor Didriksen authored
The corruption ratio is calculated as the number of corrupted pages divided by the number of pages that are not all-zeros. If all the pages are all-zeros, it is calculated as 0/0, which usually returns NaN or -NaN depending on compiler and optimization levels. Clang's UBSAN warns that division by zero is undefined behavior. Return NaN directly if all the pages are all-zeros to avoid the undefined behavior. Change-Id: Idd64aea7d94efdef9cc7aa227eaee7d719bde81e
Tor Didriksen authoredThe corruption ratio is calculated as the number of corrupted pages divided by the number of pages that are not all-zeros. If all the pages are all-zeros, it is calculated as 0/0, which usually returns NaN or -NaN depending on compiler and optimization levels. Clang's UBSAN warns that division by zero is undefined behavior. Return NaN directly if all the pages are all-zeros to avoid the undefined behavior. Change-Id: Idd64aea7d94efdef9cc7aa227eaee7d719bde81e
Loading