<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">Feedback applied, new patch in the attachment.<br>
<br>
Adrian<br>
<br>
</div>
</span></font></div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
> On Oct 8, 2015, at 8:48 AM, Adrian Zgorzalek <adek@fb.com> wrote:<br>
> <br>
> Great! I did not notice, that we already have exactly the same logic in SemaDeclAttr.cpp.<br>
> Maybe it would be possible even to refactor it in such a way that this code is written only once.<br>
> <br>
> Adrian<br>
>> On Oct 8, 2015, at 6:53 AM, Aaron Ballman <aaron@aaronballman.com> wrote:<br>
>> <br>
>> (Removing llvm-commits, adding cfe-commits)<br>
>> <br>
>> On Wed, Oct 7, 2015 at 8:07 PM, Adrian Zgorzalek via llvm-commits<br>
>> <llvm-commits@lists.llvm.org> wrote:<br>
>>> Hey,<br>
>>> <br>
>>> Here is an attempt to fix <a href="https://urldefense.proofpoint.com/v1/url?u=https://llvm.org/bugs/show_bug.cgi?id%3D25067&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=ZpIyPFH5RmN0EBF%2B6Om2Hg%3D%3D%0A&m=8P8ApMVHowVMPUxNPT7LA63ve6JJvA38Hc1rN4zEYvw%3D%0A&s=129aedfc04dd18acb23e1369c5712b619076e282e0a4e07452ac187e4d37d43a">
https://urldefense.proofpoint.com/v1/url?u=https://llvm.org/bugs/show_bug.cgi?id%3D25067&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=ZpIyPFH5RmN0EBF%2B6Om2Hg%3D%3D%0A&m=8P8ApMVHowVMPUxNPT7LA63ve6JJvA38Hc1rN4zEYvw%3D%0A&s=129aedfc04dd18acb23e1369c5712b619076e282e0a4e07452ac187e4d37d43a</a>.<br>
>> <br>
>> Thank you for working on this!<br>
>> <br>
>>> <br>
>>> Summary:<br>
>>> <br>
>>> After introducing no_sanitize, we try to map no_sanitize_* into a<br>
>>> no_sanitize(“*”), the switch in code, however doesn’t handle cases when<br>
>>> attribute is surrounded by two underscores on each of the ends. In this<br>
>>> patch I am trying to utilize existing normalizeAttrName function, by<br>
>>> exposing it to outside world and using it before feeding input to the<br>
>>> switch.<br>
>>> <br>
>>> Added unit tests for the crashes I encountered and patched.<br>
>> <br>
>> I am hesitant to expose a normalized attribute name API like that<br>
>> because very little should ever care about the actual spelling string<br>
>> of the attribute; instead, it should be looking at the semantic<br>
>> spelling or the (parsed) attribute kind. However, the no sanitize<br>
>> attributes are a bit strange in that they don't have different<br>
>> semantic spellings, but instead use the list of sanitizers, so that<br>
>> approach won't work.<br>
>> <br>
>> I think the better way to handle this is to refactor SemaDeclAttr.cpp<br>
>> to have a helper function named normalizeName() and use it in<br>
>> handleOwnershipAttr, handleFormatAttr, handleModeAttr, and<br>
>> handleNoSanitizeSpecificAttr. It can be used for normalizing attribute<br>
>> names as well as attribute argument names.<br>
>> <br>
>> ~Aaron<br>
> <br>
<br>
</div>
</span></font></div>
</body>
</html>