Don't use [[noreturn]]

This commit is contained in:
Eelco Dolstra 2018-01-19 14:58:26 +01:00
parent 3c4c30eadd
commit 89a2a11d9f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -337,10 +337,6 @@ Path EvalState::checkSourcePath(const Path & path_)
{ {
if (!allowedPaths) return path_; if (!allowedPaths) return path_;
auto doThrow = [&]() [[noreturn]] {
throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_);
};
bool found = false; bool found = false;
for (auto & i : *allowedPaths) { for (auto & i : *allowedPaths) {
@ -350,7 +346,8 @@ Path EvalState::checkSourcePath(const Path & path_)
} }
} }
if (!found) doThrow(); if (!found)
throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_);
/* Resolve symlinks. */ /* Resolve symlinks. */
debug(format("checking access to '%s'") % path_); debug(format("checking access to '%s'") % path_);
@ -361,7 +358,7 @@ Path EvalState::checkSourcePath(const Path & path_)
return path; return path;
} }
doThrow(); throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path);
} }