Fix UBSAN failure in RangeTest.cpp with libstdc++-v4.9
authorYedidya Feldblum <yfeldblum@fb.com>
Sat, 9 Dec 2017 17:47:06 +0000 (09:47 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 9 Dec 2017 17:51:17 +0000 (09:51 -0800)
commit2d3c33462242cada87a857143101cd99cd94b8f8
treeb610388051ffbb6e89a78e7afd4a9503de378c7f
parentb92bbedce7866bf3760863604e1af1e8e42db24a
Fix UBSAN failure in RangeTest.cpp with libstdc++-v4.9

Summary:
[Folly] Fix UBSAN failure in `RangeTest.cpp` with `libstdc++-v4.9`.

The implementation of `std::array` in `libstdc++-v4.9` has undefined behavior in the case of the zero-length array - dereferencing (but immediately taking the address again) of `nullptr`. This is fixed in `libstdc++-v5`.

Reviewed By: ot

Differential Revision: D6528614

fbshipit-source-id: 26be6bdc28d9e6dc6e6293a4d4ecffd769c01413
folly/test/RangeTest.cpp