From da766d872cafd7ce71f08a839643bdddb613870b Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 6 Jul 2012 19:59:29 +0000 Subject: [PATCH] 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 --- src/cc65/coptptrstore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.39.5