From c1823bf865fd8c36521112fa20747ec417a75f86 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Sun, 7 Dec 2014 20:31:38 +0100 Subject: fix a bug in apu_blarrg.c when compiled with aggressive-loop- produce bad code when accessing an array with an out-of-bounds index. --- source/apu_blargg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/apu_blargg.c') diff --git a/source/apu_blargg.c b/source/apu_blargg.c index b1bb258..0a1c334 100644 --- a/source/apu_blargg.c +++ b/source/apu_blargg.c @@ -1610,7 +1610,7 @@ static void spc_cpu_write( int data, int addr, int time ) else { *(&(m.ram.ram[0]) + reg + ROM_ADDR) = CPU_PAD_FILL; /* restore overwritten padding */ - spc_cpu_write( data, reg + ROM_ADDR - 0x10000, time ); + spc_cpu_write( data, addr & 0xFFFF, time ); } } } -- cgit v1.2.3