[PATCH] D57524: Fix ICE on attempt to add an addr space qual to a type qualified by an addr space

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 1 09:06:55 PST 2019


rjmccall added inline comments.


================
Comment at: lib/Sema/SemaInit.cpp:4693
+        T2Quals.addAddressSpace(AS2);
+      QualType WithAScv1T4 = S.Context.getQualifiedType(IgnoreAScv2T2, T1Quals);
+      Sequence.AddQualificationConversionStep(WithAScv1T4, ValueKind);
----------------
Anastasia wrote:
> rjmccall wrote:
> > `Qualifiers::addQualifiers` should let you do this in a single step.  Also, you seem to be modifying `T2Quals` here after the last use of it.
> Ok, I will update to use Qualifies methods directly.
> 
> As for `T2Quals` I was thinking it might make sense to restore the original value in case some code later will be added to use it (to prevent bugs)... but may be it's too hypothetical. :)
> 
> Thanks!
That's not unreasonable, but if you're going to do that, you should do it unconditionally, not just in a `AS1 != AS2` block — or better yet, make new locals for `T1QualsWithoutAS`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57524/new/

https://reviews.llvm.org/D57524





More information about the cfe-commits mailing list