From b1ef30736694f644e2e473429257a18b64a7615c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Jan 2018 10:34:26 +0200 Subject: Fix few undefined behavior (ubsan) bugs --- build2/cc/windows-rpath.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'build2/cc/windows-rpath.cxx') diff --git a/build2/cc/windows-rpath.cxx b/build2/cc/windows-rpath.cxx index 48e40bd..b28ce42 100644 --- a/build2/cc/windows-rpath.cxx +++ b/build2/cc/windows-rpath.cxx @@ -146,9 +146,10 @@ namespace build2 { // Get .pdb if there is one. // - const target* pdb ( - find_adhoc_member (*l, *bs.find_target_type ("pdb"))); - + const target_type* tt (bs.find_target_type ("pdb")); + const target* pdb (tt != nullptr + ? find_adhoc_member (*l, *tt) + : nullptr); r.insert ( windows_dll { f, -- cgit v1.1