dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_scanner.l,1.8,1.9


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_scanner.l,1.8,1.9
Date: Wed, 27 Nov 2002 19:06:58 -0500

Update of /cvsroot/dotgnu-pnet/pnet/ilasm
In directory subversions:/tmp/cvs-serv13385/ilasm

Modified Files:
        ilasm_scanner.l 
Log Message:


Stop at 3 octal digits or 2 hex digits when processing escape sequences
inside strings in the assembler.


Index: ilasm_scanner.l
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_scanner.l,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** ilasm_scanner.l     31 Oct 2002 14:21:02 -0000      1.8
--- ilasm_scanner.l     28 Nov 2002 00:06:56 -0000      1.9
***************
*** 119,123 ****
        char *save = text;
        char *out = text;
!       int ch;
        static char const escapes[] =
                        "\007\010cd\033\014ghijklm\012opq\015s\011u\013wxyz";
--- 119,123 ----
        char *save = text;
        char *out = text;
!       int ch, numDigits;
        static char const escapes[] =
                        "\007\010cd\033\014ghijklm\012opq\015s\011u\013wxyz";
***************
*** 143,147 ****
                                ++text;
                                ch = 0;
!                               while(*text != '\0')
                                {
                                        if(*text >= '0' && *text <= '9')
--- 143,148 ----
                                ++text;
                                ch = 0;
!                               numDigits = 0;
!                               while(numDigits < 2 && *text != '\0')
                                {
                                        if(*text >= '0' && *text <= '9')
***************
*** 153,156 ****
--- 154,158 ----
                                        else
                                                break;
+                                       ++numDigits;
                                }
                                *out++ = (char)ch;
***************
*** 165,172 ****
                        {
                                /* Octal character */
                                ch = *text++ - '0';
!                               while(*text >= '0' && *text <= '7')
                                {
                                        ch = ch * 8 + (*text++ - '0');
                                }
                                *out++ = (char)ch;
--- 167,176 ----
                        {
                                /* Octal character */
+                               numDigits = 1;
                                ch = *text++ - '0';
!                               while(numDigits < 3 && *text >= '0' && *text <= 
'7')
                                {
                                        ch = ch * 8 + (*text++ - '0');
+                                       ++numDigits;
                                }
                                *out++ = (char)ch;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]