r214333 - Add a state variable to the loop hint attribute.

Aaron Ballman aaron at aaronballman.com
Thu Jul 31 14:34:09 PDT 2014


On Thu, Jul 31, 2014 at 5:19 PM, Tyler Nowicki <tnowicki at apple.com> wrote:
> Hi Aaron,
>
> Thanks for investigating this!
>
> I was looking at the code again and I thought maybe the crash is due to this
> code in HandlePragmaLoopHint
>
>   IdentifierInfo *OptionInfo = Info->Option.getIdentifierInfo();
>   Hint.OptionLoc = IdentifierLoc::create(
>       Actions.Context, Info->Option.getLocation(), OptionInfo);
>
> The call to 'Info->Option.getIdentifierInfo();’ might be failing because
> with nounroll and sometimes unroll an option is not specified. I assumed it
> would just return null. But that could be a poor assumption. If that is the
> case then it should be moved below the test that returns early if #pragma
> unroll or #pragma nounroll are specified.
>
>   if (TokSize == 0 && (PragmaUnroll || PragmaNoUnroll)) {
>     ConsumeToken(); // The annotation token.
>     Hint.Range = Info->PragmaName.getLocation();
>     return true;
>   }
>
> The windows build-bots seem rather busy. Could you give this a try?

That's exactly what I found as well, however, I fixed it by checking
the token type explicitly instead of assuming it was an identifier.
Fix is in r214446.

~Aaron




More information about the cfe-commits mailing list