aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2022-06-21 14:08:18 +0200
committerThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2022-06-21 14:08:18 +0200
commit983efdbde47bd0ecaff866d43c3155761574c112 (patch)
treeb79cb0cca633a2cedabbda938d0090cc9bbd35e7 /src
parent16c6c6c963e78aff1911054fe4145b891d8e9fc8 (diff)
Forbid the tilde expansion in pure eval mode
Fix #6684
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/parser.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 8cbc2da4d..7c9b5a2db 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -520,6 +520,12 @@ path_start
$$ = new ExprPath(path);
}
| HPATH {
+ if (evalSettings.pureEval) {
+ throw Error(
+ "the path '%s' can not be resolved in pure mode",
+ std::string_view($1.p, $1.l)
+ );
+ }
Path path(getHome() + std::string($1.p + 1, $1.l - 1));
$$ = new ExprPath(path);
}