diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-02 14:28:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-02 14:28:10 +0200 |
commit | 8d743ac19a1b0c15deccfb14525eaeef56b4135b (patch) | |
tree | a6ef7627068939f3de8f09c14d06ae67c313a3ab /build2/install | |
parent | aed0c46abaebd54e2df3777aaabf461c877012f7 (diff) |
Fix few undefined behavior (ubsan) bugs
Diffstat (limited to 'build2/install')
-rw-r--r-- | build2/install/functions.cxx | 8 |
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)); + }; } } } |