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

List:       cfe-commits
Subject:    Re: [PATCH] Fix crash when assiging to a property with an invalid type
From:       jahanian <fjahanian () apple ! com>
Date:       2014-07-30 16:14:09
Message-ID: 8A1421B5-C3E9-4956-8E71-18F3C0BD843D () apple ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I don’t see a crash with TOT clang:

t.m:3:3: error: unknown type name 'A'
  A* response; // expected-error {{unknown type name 'A'}}
  ^
t.m:8:11: error: unknown type name 'A'
@property A* response;  // expected-error {{unknown type name 'A'}}
          ^
t.m:13:16: error: expected a type
- (void) foo :(A*) a   // expected-error {{expected a type}}
               ^
t.m:15:17: error: assignment to readonly property
  self.response = a;
  ~~~~~~~~~~~~~ ^ ~
4 errors generated.

- Fariborz

On Jul 30, 2014, at 12:42 AM, Olivier Goffart <ogoffart@kde.org> wrote:

> Hi,
> 
> Attached you will find a fix for a crash I have when parsing objective C with 
> missing include.
> This is a regression against clang 3.4 which did not crash.
> 
> My approach here is naive and just fixes the symptoms (the crash).
> 
> Regards
> -- 
> Olivier<0001-Fix-crash-when-assiging-to-a-property-with-an-invali.patch>


[Attachment #5 (text/html)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;">I don’t see a crash with TOT \
clang:<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;"><b>t.m:3:3: </b><span style="color: #c33720"><b>error: </b></span><b>unknown \
type name 'A'</b></div><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;">&nbsp; A* response; // expected-error {{unknown type name 'A'}}</div><div \
style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(52, 189, \
38);"><b>&nbsp; ^</b></div><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;"><b>t.m:8:11: </b><span style="color: #c33720"><b>error: </b></span><b>unknown \
type name 'A'</b></div><div style="margin: 0px; font-size: 11px; font-family: \
Menlo;">@property A* response;&nbsp; // expected-error {{unknown type name \
'A'}}</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: \
rgb(52, 189, 38);"><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</b></div><div \
style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>t.m:13:16: </b><span \
style="color: #c33720"><b>error: </b></span><b>expected a type</b></div><div \
style="margin: 0px; font-size: 11px; font-family: Menlo;">- (void) foo :(A*) a &nbsp; \
// expected-error {{expected a type}}</div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo; color: rgb(52, 189, 38);"><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; ^</b></div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;"><b>t.m:15:17: </b><span style="color: #c33720"><b>error: \
</b></span><b>assignment to readonly property</b></div><div style="margin: 0px; \
font-size: 11px; font-family: Menlo;">&nbsp; self.response = a;</div><div \
style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(52, 189, \
38);"><b>&nbsp; ~~~~~~~~~~~~~ ^ ~</b></div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;">4 errors generated.</div><div><br></div><div>- \
Fariborz</div><div><br></div><div><div>On Jul 30, 2014, at 12:42 AM, Olivier Goffart \
&lt;<a href="mailto:ogoffart@kde.org">ogoffart@kde.org</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>Attached you \
will find a fix for a crash I have when parsing objective C with <br>missing \
include.<br>This is a regression against clang 3.4 which did not crash.<br><br>My \
approach here is naive and just fixes the symptoms (the crash).<br><br>Regards<br>-- \
<br>Olivier<span>&lt;0001-Fix-crash-when-assiging-to-a-property-with-an-invali.patch&gt;</span></blockquote></div><br></div></body></html>




_______________________________________________
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