[cfe-dev] Broken sizeof(expr) location in SemaExpr.cpp

Chandler Carruth chandlerc at google.com
Sun May 29 00:38:03 PDT 2011


On Sat, May 28, 2011 at 3:09 PM, Xi Wang <xi.wang at gmail.com> wrote:
> Cool.  Thanks a lot.  I would suggest to add the two parameters OpLoc
> and ArgRange back.

ArgRange shouldn't be needed. The entire argument is an expression, so
the expression should have the proper source range for the argument
tokens. The location of the operator itself was what we lost here.

>  This interface change also affects Sema.h and
> TreeTransform.h.

Yep, I changed it before, so I'm aware.

> BTW, the assertion you wanted might be "ArgEx->getExprLoc() == OpLoc" ;-)

I had exactly this assertion.... but I inverted the logic sadly. =[
Sorry for the problems, I wouldn't have removed OpLoc except that I
thought my assertion had proven its futility... doh!

All fixed in r132284. I've manually verified yours and several other
test cases, but let me know if something still isn't working.

>
> On Sat, May 28, 2011 at 5:53 PM, Chandler Carruth <chandlerc at google.com> wrote:
>> On Sat, May 28, 2011 at 1:53 PM, John McCall <rjmccall at apple.com> wrote:
>>> This does seem wrong.  Since you've done so much of the
>>> investigation on it, care to write up a patch? :)
>>
>> I'll look at this tonight. It's my bug, I made the change, and I see
>> clearly the error. The weird part is that I tried to add an assertion
>> to catch just this error and it didn't fire.
>>
>




More information about the cfe-dev mailing list