mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 13:57:13 +03:00
address use-after-move lint
Summary: From D56593397: 'channel' used after it was moved fbcode/eden/fs/inodes/EdenMount.cpp:2046:43: move occurred here ``` channel_2 = std::move(channel)]( ^ ``` fbcode/eden/fs/inodes/EdenMount.cpp:2040:25: the use and move are unsequenced, i.e. there is no guarantee about the order in which they are evaluated ``` channel->getAddr(), ^ ``` Reviewed By: jdelliot Differential Revision: D56645977 fbshipit-source-id: b12ff23e0eca8e5d6092e871a2cbcd1b3689d66c
This commit is contained in:
parent
096cc64769
commit
3115bb363d
@ -2032,12 +2032,15 @@ folly::Future<folly::Unit> EdenMount::fsChannelMount(bool readOnly) {
|
||||
NfsServer::NfsMountInfo mountInfo) mutable {
|
||||
auto [channel, mountdAddr] = std::move(mountInfo);
|
||||
#ifndef _WIN32
|
||||
// Channel is later moved. We must assign addr to a local var
|
||||
// to avoid the possibility of a use-after-move bug.
|
||||
auto addr = channel->getAddr();
|
||||
// TODO: teach privhelper or something to mount on Windows
|
||||
return serverState_->getPrivHelper()
|
||||
->nfsMount(
|
||||
mountPath.view(),
|
||||
mountdAddr,
|
||||
channel->getAddr(),
|
||||
addr,
|
||||
readOnly,
|
||||
iosize,
|
||||
useReaddirplus)
|
||||
|
Loading…
Reference in New Issue
Block a user