Skip to content

Commit

Permalink
fix: calls to side_condition_event_callback with non-null arity
Browse files Browse the repository at this point in the history
  • Loading branch information
alexoltean61 committed Jan 9, 2025
1 parent 790cab9 commit ec09f07
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion include/runtime/proof_trace_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ class proof_trace_callback_writer : public proof_trace_writer {
std::optional<rewrite_event_construction> current_rewrite_event_{
std::nullopt};

bool rewrite_callback_pending_;

virtual void proof_trace_header_callback(uint32_t version) { }
virtual void hook_event_callback(call_event_construction const &event) { }
virtual void rewrite_event_callback(rewrite_event_construction const &event) {
Expand Down Expand Up @@ -333,6 +335,9 @@ class proof_trace_callback_writer : public proof_trace_writer {
if (arity == 0) {
rewrite_event_callback(current_rewrite_event_.value());
}
else {
rewrite_callback_pending_ = true;
}
}

void variable(
Expand All @@ -345,7 +350,13 @@ class proof_trace_callback_writer : public proof_trace_writer {
p.second.bits = bits;
size_t new_pos = ++current_rewrite_event_->pos;
if (new_pos == current_rewrite_event_->arity) {
rewrite_event_callback(current_rewrite_event_.value());
if (rewrite_callback_pending_) {
rewrite_event_callback(current_rewrite_event_.value());
rewrite_callback_pending_ = false;
}
else {
side_condition_event_callback(current_rewrite_event_.value());
}
}
}

Expand Down

0 comments on commit ec09f07

Please sign in to comment.