]> granicus.if.org Git - llvm/commit
[Path] Set FD to -1 in moved-from TempFile
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 11 Jun 2019 16:42:42 +0000 (16:42 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 11 Jun 2019 16:42:42 +0000 (16:42 +0000)
commitef5120c189617e82674f4da9f55ab7e413dbee57
tree3d4bc9bd5da035cb2ac5f4cbd9b0ee53897aedb5
parent35ebe10afc0de2721e2335cd13ee2a43a25a064d
[Path] Set FD to -1 in moved-from TempFile

When moving a temp file, explicitly set the file descriptor to -1 so we
can never accidentally close the moved-from TempFile.

Differential revision: https://reviews.llvm.org/D63087

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363083 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Path.cpp
unittests/Support/Path.cpp