fix ubsan-detected UMR in TemporaryFile
authorLouis Brandy <ldbrandy@fb.com>
Thu, 7 Dec 2017 01:10:31 +0000 (17:10 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 7 Dec 2017 01:21:26 +0000 (17:21 -0800)
commit989c511267f61b5b172c92f39a05f1bf35392ab5
treea918f2ee3c93bd0b1cee70e02a49ff13b404b0c1
parentcc9ce0e1e7d84db3ccb553cc8c75e179459ef42f
fix ubsan-detected UMR in TemporaryFile

Summary:
Move constructors are just like any other constructors. `this` is not in a valid state. You aren't supposed to destroy `this` before move-constructing it.

This was detected by ubsan stress runs.

UBSAN report:

```
[ RUN      ] TemporaryFile.moveCtor
folly/experimental/TestUtil.cpp:91:20: runtime error: load of value 3, which is not a valid value for type 'bool'
 [ failed: 1 ]
 ````

Reviewed By: yfeldblum

Differential Revision: D6501500

fbshipit-source-id: 83bd0525ac2c1f5951f70f5596034bb6cb0ca985
folly/experimental/TestUtil.h