about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-01-19T13·58+0100
committerEelco Dolstra <edolstra@gmail.com>2018-01-19T14·00+0100
commit89a2a11d9f39f60097619212d3fed9ab8c216c8b (patch)
treef894c74e2806c23c30c4f076ac4875ef0ad0d611 /src/libexpr
parent3c4c30eadd879f512ac2075a7ba39c37ff77bf5c (diff)
Don't use [[noreturn]]
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index f8685e010e15..33a9bc614285 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -337,10 +337,6 @@ Path EvalState::checkSourcePath(const Path & path_)
 {
     if (!allowedPaths) return path_;
 
-    auto doThrow = [&]() [[noreturn]] {
-        throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_);
-    };
-
     bool found = false;
 
     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. */
     debug(format("checking access to '%s'") % path_);
@@ -361,7 +358,7 @@ Path EvalState::checkSourcePath(const Path & path_)
             return path;
     }
 
-    doThrow();
+    throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path);
 }