Due to clock vector snapshotting, a ModelAction may hold a pointer to
an inavlid ClockVector. This fix allows callers of ModelAction::print()
to prevent it from printing a corrupted ClockVector.
return act->cv->synchronized_since(this);
}
-void ModelAction::print(void) const
+/**
+ * Print nicely-formatted info about this ModelAction
+ *
+ * @param print_cv True if we want to print clock vector data. Might be false,
+ * for instance, in situations where the clock vector might be invalid
+ */
+void ModelAction::print(bool print_cv) const
{
const char *type_str, *mo_str;
switch (this->type) {
else
printf(" Rf: ?");
}
- if (cv) {
+ if (cv && print_cv) {
printf("\t");
cv->print();
} else
public:
ModelAction(action_type_t type, memory_order order, void *loc, uint64_t value = VALUE_NONE);
~ModelAction();
- void print(void) const;
+ void print(bool print_cv = true) const;
thread_id_t get_tid() const { return tid; }
action_type get_type() const { return type; }
if (isfinalfeasible()) {
printf("Earliest divergence point since last feasible execution:\n");
if (earliest_diverge)
- earliest_diverge->print();
+ earliest_diverge->print(false);
else
printf("(Not set)\n");