Skip to content

Commit b1e0383

Browse files
committed
Fixed event recording for general tracers (fixes #44)
1 parent e733699 commit b1e0383

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

changelog.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ Date: 2019-??-??
6868
[DESCRIPTION]
6969
Let's see.
7070

71+
[ENTRY]
72+
Module: kernel
73+
What: change
74+
Rank: major
75+
Thanks: Conrad Drescher
76+
[DESCRIPTION]
77+
The logic for recording events for general tracers was seriously
78+
broken as events after a call to status() have been ignored.
79+
7180
[ENTRY]
7281
Module: float
7382
What: bug

gecode/kernel/core.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,7 @@ namespace Gecode {
384384
d_stable: ;
385385
} else {
386386
// Support disabled propagators and tracing
387-
// Find a non-disabled tracer recorder (possibly null)
388-
TraceRecorder* tr = findtracerecorder();
389-
ViewTraceInfo vti; vti.other();
387+
390388
#define GECODE_STATUS_TRACE(q,s) \
391389
if ((tr != NULL) && (tr->events() & TE_PROPAGATE) && \
392390
(tr->filter()(p->group()))) { \
@@ -395,12 +393,16 @@ namespace Gecode {
395393
tr->tracer()._propagate(*this,pti); \
396394
}
397395

396+
// Find a non-disabled tracer recorder (possibly null)
397+
TraceRecorder* tr = findtracerecorder();
398+
// Remember post information
399+
ViewTraceInfo vti(pc.p.vti);
398400
goto t_unstable;
401+
399402
t_execute:
400403
stat.propagate++;
401404
if (p->disabled())
402405
goto t_put_into_idle;
403-
vti = pc.p.vti;
404406
pc.p.vti.propagator(*p);
405407
// Keep old modification event delta
406408
med_o = p->u.med;
@@ -463,8 +465,11 @@ namespace Gecode {
463465
GECODE_NEVER;
464466
}
465467
t_stable:
468+
// Restore post information
466469
pc.p.vti = vti;
470+
467471
#undef GECODE_STATUS_TRACE
472+
468473
}
469474
}
470475

0 commit comments

Comments
 (0)