add overrun check to SEE

master
Ondřej Hruška 3 years ago
parent 6e045af565
commit 10dbb3b425
  1. 6
      src/fh_see.c

@ -15,6 +15,12 @@ static void show_word(struct fh_thread_s *fh, const struct fh_word_s *w)
while (1) { while (1) {
// make sure it's aligned // make sure it's aligned
execptr = WORDALIGNED(execptr); execptr = WORDALIGNED(execptr);
if (execptr == 0 || execptr > fh->here) {
LOGE("Exec overrun without ENDWORD!");
break;
}
FHPRINT("0x%08x: ", execptr); FHPRINT("0x%08x: ", execptr);
const struct fh_instruction_s *instr = fh_instr_at(fh, execptr); const struct fh_instruction_s *instr = fh_instr_at(fh, execptr);
if (!instr) { if (!instr) {

Loading…
Cancel
Save