From 7dee9936074bcbbf9dfe4faf2d86165abb7d9eb9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 May 2018 09:30:55 +0200 Subject: Fix bug in TU checksum depdb saving logic in case of reprocess=true --- build2/cc/compile-rule.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'build2/cc') diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx index f57d5b3..b81b19a 100644 --- a/build2/cc/compile-rule.cxx +++ b/build2/cc/compile-rule.cxx @@ -858,7 +858,7 @@ namespace build2 // (whitespaces, comments, etc). // { - string cs; + optional cs; if (string* l = dd.read ()) cs = move (*l); else @@ -871,7 +871,7 @@ namespace build2 { auto p (parse_unit (a, t, li, src, psrc.first, md)); - if (cs != p.second) + if (!cs || *cs != p.second) { assert (first); // Unchanged TU has a different checksum? dd.write (p.second); @@ -880,7 +880,7 @@ namespace build2 // Don't clear if it was forced or the checksum should not be // relied upon. // - else if (first && !cs.empty ()) + else if (first && !p.second.empty ()) { // Clear the update flag and set the touch flag. Unless there // is no object file, of course. See also the md.mt logic -- cgit v1.1