SCP: Fix EXPECT bookkeeping to avoid reference after free error
This commit is contained in:
parent
5700b1f477
commit
4fff142444
1 changed files with 6 additions and 3 deletions
9
scp.c
9
scp.c
|
@ -11819,6 +11819,9 @@ if (i != exp->size) { /* Found? */
|
|||
ep->cnt, (ep->cnt == 1) ? "" : "es");
|
||||
}
|
||||
else {
|
||||
uint32 after = ep->after;
|
||||
int32 switches = ep->switches;
|
||||
|
||||
if (ep->act && *ep->act) {
|
||||
sim_debug (exp->dbit, exp->dptr, "Initiating actions: %s\n", ep->act);
|
||||
}
|
||||
|
@ -11833,9 +11836,9 @@ if (i != exp->size) { /* Found? */
|
|||
sim_exp_clr_tab (exp, ep); /* delete it */
|
||||
}
|
||||
sim_activate (&sim_expect_unit, /* schedule simulation stop when indicated */
|
||||
(ep->switches & EXP_TYP_TIME) ?
|
||||
(int32)((sim_timer_inst_per_sec ()*ep->after)/1000000.0) :
|
||||
ep->after);
|
||||
(switches & EXP_TYP_TIME) ?
|
||||
(int32)((sim_timer_inst_per_sec ()*after)/1000000.0) :
|
||||
after);
|
||||
}
|
||||
/* Matched data is no longer available for future matching */
|
||||
exp->buf_data = exp->buf_ins = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue