• Jim Meyering's avatar
    folly: ASAN-exempt scanHaystackBlock, to avoid an FP buffer overrun · 219c6976
    Jim Meyering authored
    Summary:
    scanHaystackBlock may read-overrun the needle.data() buffer by
    up to 15 bytes, but that overrun will never cross a page boundary.
    The fix is to turn off ASAN-checking for this function, but since
    that attribute is accompanied by a "noinline" one (which conflicts
    with the function's own "inline"), I have also removed the "inline"
    attribute on both decl and defn.  That is a good thing, regardless:
    these days, there are very few cases in which we should be trying to
    tell the compiler to inline.
    
    Test Plan:
    Before, this would elicit an ASAN abort.  Now it passes 100%:
    
    fbconfig --platform-all=gcc-4.8.1-glibc-2.17 --sanitize=address \
    folly/test:range_test && fbmake runtests
    
    Reviewed By: philipp@fb.com
    
    FB internal diff: D1162982
    219c6976
Range.cpp 9.87 KB