[LIB]: Only check if it is a cacheline boundary when the offset changes

So that we print the boundary after the last member in a bitfield.

Spotted by Matthew Wilcox.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-03-28 13:21:27 -03:00
parent c87d8d831a
commit 27ac8cec6c
1 changed files with 7 additions and 5 deletions

View File

@ -2521,11 +2521,13 @@ size_t class__fprintf(const struct class *self, const struct cu *cu,
struct tag *type;
const ssize_t cc_last_size = pos->offset - last_offset;
printed += class__fprintf_cacheline_boundary(last_cacheline,
sum, sum_holes,
&newline,
&last_cacheline,
indent + 1, fp);
if (pos->offset != last_offset)
printed +=
class__fprintf_cacheline_boundary(last_cacheline,
sum, sum_holes,
&newline,
&last_cacheline,
indent + 1, fp);
if (last_offset != -1) {
if (cc_last_size > 0 &&
(size_t)cc_last_size < last_size) {