From: cuz Date: Thu, 30 Jun 2005 20:29:18 +0000 (+0000) Subject: Fixed a bug X-Git-Tag: V2.12.0~319 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=37873a947fe92af1ddf2807370698dc8550a3e27;p=cc65 Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@3524 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/da65/main.c b/src/da65/main.c index ac1511b57..1051c7488 100644 --- a/src/da65/main.c +++ b/src/da65/main.c @@ -290,11 +290,21 @@ static void OneOpcode (unsigned RemainingBytes) switch (Style) { case atDefault: - case atCode: D->Handler (D); PC += D->Size; break; + case atCode: + /* Beware: If we don't have enough bytes left to disassemble the + * following insn, fall through to byte mode. + */ + if (D->Size <= RemainingBytes) { + D->Handler (D); + PC += D->Size; + break; + } + /* FALLTHROUGH */ + case atByteTab: ByteTable (); break;