bug-global
[Top][All Lists]
Advanced

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

Re: Segmentation fault while parsing v8 with GTAGSFORCECPP=1


From: Alexander Gusak
Subject: Re: Segmentation fault while parsing v8 with GTAGSFORCECPP=1
Date: Fri, 14 Dec 2012 13:51:42 +0200

Hi,

The issue is fixed by your patch.
Thanks a lot.
--
Best regards,
Alexander.

On 14 December 2012 05:50, Shigio YAMAGUCHI <address@hidden> wrote:
On Thu, 13 Dec 2012 12:16:27 +0200
Alexander Gusak <address@hidden> wrote:

> Hi,
>
> I've attached lithium-ia32.h from v8/src/ia32/.

Thank you for sending the file.
I believe I have fixed the bug. Would you please try the following patch ?

Thank you in advance.

Index: Cpp.c
===================================================================
RCS file: /sources/global/global/libparser/Cpp.c,v
retrieving revision 1.8
diff -c -r1.8 Cpp.c
*** Cpp.c       13 Oct 2012 07:01:22 -0000      1.8
--- Cpp.c       14 Dec 2012 02:24:47 -0000
***************
*** 72,77 ****
--- 72,78 ----
        int startclass, startthrow, startmacro, startsharp, startequal;
        char classname[MAXTOKEN];
        char completename[MAXCOMPLETENAME];
+       char *completename_limit = &completename[sizeof(completename)];
        int classlevel;
        struct {
                char *classname;
***************
*** 209,218 ****

                                if (++classlevel >= MAXCLASSSTACK)
                                        die("class stack over flow.[%s]", curfile);
!                               if (classlevel > 1)
                                        *p++ = '.';
                                stack[classlevel].classname = p;
!                               while (*q)
                                        *p++ = *q++;
                                stack[classlevel].terminate = p;
                                stack[classlevel].level = level;
--- 210,219 ----

                                if (++classlevel >= MAXCLASSSTACK)
                                        die("class stack over flow.[%s]", curfile);
!                               if (classlevel > 1 && p < completename_limit)
                                        *p++ = '.';
                                stack[classlevel].classname = p;
!                               while (*q && p < completename_limit)
                                        *p++ = *q++;
                                stack[classlevel].terminate = p;
                                stack[classlevel].level = level;
***************
*** 614,622 ****
                else if (c == '{' /* } */) {
                        pushbacktoken();
                        return 1;
!               } else if (c == /* { */'}')
                        break;
!               else if (c == '=')
                        break;
                /* pick up symbol */
                if (c == SYMBOL)
--- 615,624 ----
                else if (c == '{' /* } */) {
                        pushbacktoken();
                        return 1;
!               } else if (c == /* { */'}') {
!                       pushbacktoken();
                        break;
!               } else if (c == '=')
                        break;
                /* pick up symbol */
                if (c == SYMBOL)

--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


reply via email to

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