diff --git a/engines/glk/tads/tads2/output.cpp b/engines/glk/tads/tads2/output.cpp index 79284b7b924..5f7e46b70be 100644 --- a/engines/glk/tads/tads2/output.cpp +++ b/engines/glk/tads/tads2/output.cpp @@ -2448,7 +2448,7 @@ static int outformatlen_stream(out_stream_info *stream, || !scumm_stricmp(tagbuf, "em") || !scumm_stricmp(tagbuf, "strong")) { - int attr; + int attr = 0; /* choose the attribute flag */ switch (tagbuf[0]) diff --git a/engines/glk/tads/tads2/run.cpp b/engines/glk/tads/tads2/run.cpp index 64b52a4d79d..0def6a771be 100644 --- a/engines/glk/tads/tads2/run.cpp +++ b/engines/glk/tads/tads2/run.cpp @@ -1096,15 +1096,19 @@ void runexe(runcxdef *ctx, uchar *p0, objnum self, objnum target, runsdef val; /* stack element (for pushing) */ runsdef val2; /* another one (for popping in two-op instructions) */ uint ofs; /* offset in code of current execution */ - prpnum prop; /* property number, when needed */ - objnum obj; /* object number, when needed */ + prpnum prop = 0; /* property number, when needed */ + objnum obj = 0; /* object number, when needed */ runsdef *noreg rstsp; /* sp to reset to on DISCARD instructions */ - uchar *lstp; /* list pointer */ + uchar *lstp = nullptr; /* list pointer */ int nargc; /* argument count of called function */ runsdef *valp; runsdef *stkval; - int i; + int i = 0; int brkchk; + runsdef val3; + int asityp; + int asiext = 0; + int lclnum = 0; #ifndef DBG_OFF int err; @@ -1954,11 +1958,6 @@ resume_from_error: default: if ((opc & OPCASI_MASK) == OPCASI_MASK) { - runsdef val3; - int asityp; - int asiext; - int lclnum; - valp = &val; stkval = &val; diff --git a/engines/glk/tads/tads2/run.h b/engines/glk/tads/tads2/run.h index 0a39fca4e2d..8b7c5905fca 100644 --- a/engines/glk/tads/tads2/run.h +++ b/engines/glk/tads/tads2/run.h @@ -57,7 +57,11 @@ struct runsdef { objnum runsvobj; /* object value */ prpnum runsvprp; /* property number value */ uchar *runsvstr; /* string/list value */ - } runsv; + } runsv; + + runsdef() : runstyp(0) { + runsv.runsvnum = 0; + } }; /* external function control structure */