git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5163
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2008-05-19 Philipp Klaus Krause <pkk AT spth.de>
+
+ * src/SDCCpeeph.c (callFuncByName):
+ Support nested parenthesis in peephole function arguments (#1967300)
+
2008-05-19 Raphael Neider <rneider AT web.de>
* src/pic16/gen.c (pic16_emitpLabel,pic16_emitpLabelFORCE):
/* and there can be no additional conditions. */
if (c == '(')
{
- cmdTerm = funcArgs;
- while ((c = *cmdTerm) && c != ')')
- cmdTerm++;
+
+ int num_parenthesis = 0;
+ cmdTerm = funcArgs;
+
+ while ((c = *cmdTerm) && (c != ')' || num_parenthesis))
+ {
+ if (c == '(')
+ num_parenthesis++;
+ else if (c == ')')
+ num_parenthesis--;
+ cmdTerm++;
+ }
*cmdTerm = '\0'; /* terminate the arguments */
if (c == ')')
{