From: uz Date: Fri, 6 Jul 2012 19:59:29 +0000 (+0000) Subject: Small code changes for more safety (and to be compatible with the new shift X-Git-Tag: V2.14~309 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=da766d872cafd7ce71f08a839643bdddb613870b;p=cc65 Small code changes for more safety (and to be compatible with the new shift routines that don't use the stack). git-svn-id: svn://svn.cc65.org/cc65/trunk@5762 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/coptptrstore.c b/src/cc65/coptptrstore.c index 95689b4ac..754388de8 100644 --- a/src/cc65/coptptrstore.c +++ b/src/cc65/coptptrstore.c @@ -36,6 +36,7 @@ #include /* common */ +#include "chartype.h" #include "strbuf.h" #include "xmalloc.h" #include "xsprintf.h" @@ -65,8 +66,11 @@ static unsigned OptPtrStore1Sub (CodeSeg* S, unsigned I, CodeEntry** const L) if (L[0]->OPC == OP65_AND || L[0]->OPC == OP65_EOR || L[0]->OPC == OP65_ORA || - (L[0]->OPC == OP65_JSR && strncmp (L[0]->Arg, "shlax", 5) == 0) || - (L[0]->OPC == OP65_JSR && strncmp (L[0]->Arg, "shrax", 5) == 0)) { + (L[0]->OPC == OP65_JSR && + (strncmp (L[0]->Arg, "shlax", 5) == 0 || + strncmp (L[0]->Arg, "shrax", 5) == 0) && + strlen (L[0]->Arg) == 6 && + IsDigit (L[0]->Arg[5]))) { /* One insn */ return 1;