vere: don't crash when slogging during replay

We're not guaranteed to have the sog_f callback set when
_pier_on_lord_slog gets called, so we should make sure there's a
function there before we call it.
This commit is contained in:
Fang 2020-10-01 15:54:36 +02:00
parent a6af035532
commit 1bce077ab4
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -972,11 +972,21 @@ _pier_on_lord_slog(void* ptr_v, c3_w pri_w, u3_noun tan)
u3C.stderr_log_f(tan_c);
c3_free(tan_c);
pir_u->sog_f(pir_u->sop_p, pri_w, tan);
if ( 0 != pir_u->sog_f ) {
pir_u->sog_f(pir_u->sop_p, pri_w, tan);
}
else {
u3z(tan);
}
}
else {
u3_pier_tank(0, pri_w, u3k(tan));
pir_u->sog_f(pir_u->sop_p, pri_w, tan);
if ( 0 != pir_u->sog_f ) {
pir_u->sog_f(pir_u->sop_p, pri_w, tan);
}
else {
u3z(tan);
}
}
}