aboutsummaryrefslogtreecommitdiff
path: root/build2/install
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-02 14:28:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-01-02 14:28:10 +0200
commit8d743ac19a1b0c15deccfb14525eaeef56b4135b (patch)
treea6ef7627068939f3de8f09c14d06ae67c313a3ab /build2/install
parentaed0c46abaebd54e2df3777aaabf461c877012f7 (diff)
Fix few undefined behavior (ubsan) bugs
Diffstat (limited to 'build2/install')
-rw-r--r--build2/install/functions.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/build2/install/functions.cxx b/build2/install/functions.cxx
index b9298b2..dbe43c8 100644
--- a/build2/install/functions.cxx
+++ b/build2/install/functions.cxx
@@ -21,7 +21,13 @@ namespace build2
// Resolve potentially relative install.* value to an absolute directory
// based on (other) install.* values visible from the calling scope.
//
- f["resolve"] = &resolve_dir;
+ f[".resolve"] = [] (const scope* s, dir_path d)
+ {
+ if (s == nullptr)
+ fail << "install.resolve() called out of scope" << endf;
+
+ return resolve_dir (*s, move (d));
+ };
}
}
}