[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: [PATCH] Fix crash in typo correction while correcting enum within a struct in C
From:       Kaelyn Takata <rikka () google ! com>
Date:       2015-01-09 2:13:23
Message-ID: CAPp_XeX5oYM80JEV8noRh1Hjj+QnxakOxGTn1EX7pbqHh248RQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Other than the 80 column violation around line 5994 where the
cast<CXXRecordDecl> was changed to a dyn_cast (using clang-format is the
easiest way to fix the formatting), the patch LGTM.

On Thu, Jan 8, 2015 at 1:12 PM, Olivier Goffart <ogoffart@kde.org> wrote:

> Hi,
>
> Please review the attached patch.
> It fix a crash while trying to compile the code that is in the testcase
> (in C
> mode). This crash is a regression since 3.5
>
> The problem is that "isCXXClassMember" for the NameDecl of the enum values
> returns true even tough we are in C mode. Therefore, the DeclContext is
> not a
> CXXRecordDecl, but just a plain RecordDecl.
> I'm taking the least intrusive approach by handling the case in which the
> cast
> would otherwise fail.
>
> Thanks
> --
> Olivier

[Attachment #5 (text/html)]

<div dir="ltr">Other than the 80 column violation around line 5994 where the \
cast&lt;CXXRecordDecl&gt; was changed to a dyn_cast (using clang-format is the \
easiest way to fix the formatting), the patch LGTM.</div><div \
class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 8, 2015 at 1:12 PM, \
Olivier Goffart <span dir="ltr">&lt;<a href="mailto:ogoffart@kde.org" \
target="_blank">ogoffart@kde.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi,<br> <br>
Please review the attached patch.<br>
It fix a crash while trying to compile the code that is in the testcase (in C<br>
mode). This crash is a regression since 3.5<br>
<br>
The problem is that &quot;isCXXClassMember&quot; for the NameDecl of the enum \
values<br> returns true even tough we are in C mode. Therefore, the DeclContext is \
not a<br> CXXRecordDecl, but just a plain RecordDecl.<br>
I&#39;m taking the least intrusive approach by handling the case in which the \
cast<br> would otherwise fail.<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888">--<br>
Olivier</font></span></blockquote></div><br></div>



_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic