From cc469a3b00349bc805b4229fb7642336a074b85f Mon Sep 17 00:00:00 2001 From: johanknol Date: Tue, 20 Mar 2001 11:14:25 +0000 Subject: [PATCH] Increased internal buffer for large function and variable names. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@693 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCpeeph.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SDCCpeeph.c b/src/SDCCpeeph.c index dbcb3eb0..fb207ff2 100644 --- a/src/SDCCpeeph.c +++ b/src/SDCCpeeph.c @@ -709,7 +709,9 @@ replaceRule (lineNode ** shead, lineNode * stail, peepRule * pr) { lineNode *cl = NULL; lineNode *pl = NULL, *lhead = NULL; - char lb[MAX_PATTERN_LEN]; + /* a long function name and long variable name can evaluate to + 4x max pattern length e.g. "mov dptr,((fie_var>>8)<<8)+fie_var" */ + char lb[MAX_PATTERN_LEN*4]; char *lbp; lineNode *comment = NULL; @@ -745,11 +747,13 @@ replaceRule (lineNode ** shead, lineNode * stail, peepRule * pr) l++; continue; } - while (*v) + while (*v) { *lbp++ = *v++; + } l++; - while (isdigit (*l)) + while (isdigit (*l)) { l++; + } continue; } *lbp++ = *l++; @@ -953,7 +957,6 @@ top: for (spl = *pls; spl; spl = spl->next) { - /* if inline assembler then no peep hole */ if (spl->isInline) continue; -- 2.47.2