Assume p is not nullptr in storeUnaligned
Summary: Because we're constructing the value with a placement new, which has some of C++'s most unhelpful behavior ever put into the spec: If `p` is `nullptr` and we are not compiling in C++14 mode, where the restriction was changed, then the placement new will do absolutely nothing at all. By adding the assumption that `p` is not `nullptr`, we'll trip a segfault in release mode rather than failing silently. Note that MSVC would generate the nullptr check regardless of which mode it's in, so this assume forces the removal of the check. Reviewed By: yfeldblum Differential Revision: D3651116 fbshipit-source-id: ee15a38f85ce4e3cb3186fda0b7bcca39acda27a
Showing
Please register or sign in to comment