[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 27 06:39:30 PDT 2018


Anastasia added a comment.

In https://reviews.llvm.org/D49723#1174837, @asavonic wrote:

> In https://reviews.llvm.org/D49723#1173352, @Anastasia wrote:
>
> > Btw, has this restriction been removed from CL 2.0?
>
>
> No, it applies for CL2.0 as well.


It seems however the restriction on pointer to pointer was removed (see s6.9.a last item) in CL2.0.



================
Comment at: lib/Sema/SemaDecl.cpp:8187
+      // walk around RecordDecl::fields().
+      assert((PT->isArrayType() || PT->isRecordType()) && "Unexpected type.");
+      const Type *FieldRecTy = Field->getType()->getPointeeOrArrayElementType();
----------------
Do we need to assert PT here too? It doesn't seem to be modified in this loop...


Repository:
  rC Clang

https://reviews.llvm.org/D49723





More information about the cfe-commits mailing list