From 4d0a1c2359e069c37fc9cccb1824ad22620afa9f Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Tue, 13 Sep 2016 10:56:14 +0200 Subject: [PATCH] Fix PR20599 by only updating needed members of statistic_decl. After introducing @variance in commit 63ead7fa, stat_ops and bit_shift need to be tracked within the statistic_decl. Before this update, new histogram always rewrote these new members, which was causing the problem described in PR20599. elaborate.cxx: Only rewrite type, linear_low, linear_high, and linear_step, when binding new histogram with a global. --- elaborate.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/elaborate.cxx b/elaborate.cxx index 010fda038..bd26d1541 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1382,7 +1382,12 @@ struct stat_decl_collector if (!(old_stat == new_stat)) { if (old_stat.type == statistic_decl::none) - i->second = new_stat; + { + i->second.type = new_stat.type; + i->second.linear_low = new_stat.linear_low; + i->second.linear_high = new_stat.linear_high; + i->second.linear_step = new_stat.linear_step; + } else { // FIXME: Support multiple co-declared histogram types -- 2.43.5