]> git.sur5r.net Git - cc65/commitdiff
Add explicit check for CPU_UNKNOWN to avoid SIGSEGV
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 20 Nov 2005 13:09:41 +0000 (13:09 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 20 Nov 2005 13:09:41 +0000 (13:09 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3652 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/instr.c

index 1603dcd9f1d7cb5564667b54d22ef7847bb2afaa..bebc0ae9b384e7389d5b80a33e280dc4845cb2c8 100644 (file)
@@ -1427,7 +1427,7 @@ void SetCPU (cpu_t NewCPU)
     CHECK (NewCPU < CPU_COUNT);
 
     /* Check if we have support for the new CPU, if so, use it */
-    if (InsTabs[NewCPU]) {
+    if (NewCPU != CPU_UNKNOWN && InsTabs[NewCPU]) {
        CPU = NewCPU;
        InsTab = InsTabs[CPU];
     } else {