Skip to content
  • Tor Didriksen's avatar
    101204ad
    Bug#27692051 IBD2SDI.CC RUNTIME ERROR: DIVISION BY ZERO · 101204ad
    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
    101204ad
    Bug#27692051 IBD2SDI.CC RUNTIME ERROR: DIVISION BY ZERO
    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
Loading