aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-24 09:30:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-24 09:30:55 +0200
commit7dee9936074bcbbf9dfe4faf2d86165abb7d9eb9 (patch)
tree884463e40ebc497e19bb93fbd0439e27116e7b64
parent2fbbc3b8c6def41baaa1e02048713c2a772693ab (diff)
Fix bug in TU checksum depdb saving logic in case of reprocess=true
-rw-r--r--build2/cc/compile-rule.cxx6
-rw-r--r--build2/depdb.cxx2
-rw-r--r--build2/depdb.hxx2
3 files changed, 5 insertions, 5 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
diff --git a/build2/depdb.cxx b/build2/depdb.cxx
index a66afdf..df73dfd 100644
--- a/build2/depdb.cxx
+++ b/build2/depdb.cxx
@@ -109,7 +109,7 @@ namespace build2
if (state_ == state::read_eof)
return nullptr;
- getline (fs_, line_); // Calls data_.erase().
+ getline (fs_, line_); // Calls line_.erase().
// The line should always end with a newline. If it doesn't, then this
// line (and the rest of the database) is assumed corrupted. Also peek at
diff --git a/build2/depdb.hxx b/build2/depdb.hxx
index 906cbe5..9885723 100644
--- a/build2/depdb.hxx
+++ b/build2/depdb.hxx
@@ -97,7 +97,7 @@ namespace build2
// the next line in the database (which you are free to move from). If you
// then call write(), this line will be overwritten.
//
- // If the result is NULL, then it means no next line is available. This
+ // If the result is NULL, then it means no next line is unavailable. This
// can be due to several reasons:
//
// - eof reached (you can detect this by calling more() before read())