add asan debug and fix buffer overflow on fmopl.c (#333)

This commit is contained in:
grant2258 2018-08-06 13:46:42 +01:00 committed by markwkidd
parent 9bc690853f
commit 444cd794df
2 changed files with 5 additions and 4 deletions

View File

@ -413,7 +413,8 @@ endif
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g3
CFLAGS += -fsanitize=address -fno-omit-frame-pointer -g -O0
LDFLAGS += -fsanitize=address
else
CFLAGS += -O2 -DNDEBUG
endif

View File

@ -1219,9 +1219,9 @@ static int init_tables(void)
else
sin_tab[3*SIN_LEN+i] = sin_tab[i & (SIN_MASK>>2)];
log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: sin1[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[1*SIN_LEN+i], tl_tab[sin_tab[1*SIN_LEN+i]] );
log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: sin2[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[2*SIN_LEN+i], tl_tab[sin_tab[2*SIN_LEN+i]] );
log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: sin3[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[3*SIN_LEN+i], tl_tab[sin_tab[3*SIN_LEN+i]] );
// log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: sin1[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[1*SIN_LEN+i], tl_tab[sin_tab[1*SIN_LEN+i]] );
// log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: sin2[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[2*SIN_LEN+i], tl_tab[sin_tab[2*SIN_LEN+i]] );
// log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: sin3[%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[3*SIN_LEN+i], tl_tab[sin_tab[3*SIN_LEN+i]] );
}
log_cb(RETRO_LOG_DEBUG, LOGPRE "FMOPL.C: ENV_QUIET= %08x (dec*8=%i)\n", ENV_QUIET, ENV_QUIET*8 );