diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-24 09:30:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-24 09:30:55 +0200 |
commit | 7dee9936074bcbbf9dfe4faf2d86165abb7d9eb9 (patch) | |
tree | 884463e40ebc497e19bb93fbd0439e27116e7b64 /build2/cc | |
parent | 2fbbc3b8c6def41baaa1e02048713c2a772693ab (diff) |
Fix bug in TU checksum depdb saving logic in case of reprocess=true
Diffstat (limited to 'build2/cc')
-rw-r--r-- | build2/cc/compile-rule.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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<string> 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 |