Fix lval/rval confusion in imgdiag
Missing indirections caused missed counts.
Bug: 62554875
Test: make -j 40 test-art-target-gtest-imgdiag_test + some hand tests.
Change-Id: I13beeb1ca611bbf094d50a40f9cc9d4095803950
diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc
index d3ab838..2763c07 100644
--- a/imgdiag/imgdiag.cc
+++ b/imgdiag/imgdiag.cc
@@ -254,7 +254,7 @@
uint8_t* remote_ptr = &remote_contents_[offset];
if (memcmp(local_ptr, remote_ptr, kPageSize) != 0) {
- different_pages++;
+ ++*different_pages;
// Count the number of 32-bit integers that are different.
for (size_t i = 0; i < kPageSize / sizeof(uint32_t); ++i) {
@@ -262,7 +262,7 @@
const uint32_t* local_ptr_int32 = reinterpret_cast<const uint32_t*>(local_ptr);
if (remote_ptr_int32[i] != local_ptr_int32[i]) {
- different_int32s++;
+ ++*different_int32s;
}
}
}
@@ -286,7 +286,7 @@
page_idx = (offset + page_off_begin) / kPageSize;
if (*local_ptr != *remote_ptr) {
// Track number of bytes that are different
- different_bytes++;
+ ++*different_bytes;
}
// Independently count the # of dirty pages on the remote side
@@ -307,7 +307,7 @@
os << error_msg;
return false;
} else if (dirtiness > 0) {
- (*dirty_pages)++;
+ ++*dirty_pages;
dirty_page_set_local->insert(dirty_page_set_local->end(), virtual_page_idx);
}
@@ -315,11 +315,11 @@
bool is_private = page_count == 1;
if (page_count == 1) {
- (*private_pages)++;
+ ++*private_pages;
}
if (is_dirty && is_private) {
- (*private_dirty_pages)++;
+ ++*private_dirty_pages;
}
}
}
@@ -556,7 +556,7 @@
if (region_data->field_dirty_count->find(i) != region_data->field_dirty_count->end()) {
dirty_count = (*region_data->field_dirty_count)[i];
}
- (*region_data->field_dirty_count)[i] = dirty_count;
+ (*region_data->field_dirty_count)[i] = dirty_count + 1;
}
}