From 37873a947fe92af1ddf2807370698dc8550a3e27 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 30 Jun 2005 20:29:18 +0000 Subject: [PATCH] Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@3524 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/da65/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; -- 2.39.5