================
@@ -237,13 +357,24 @@ void FactsGenerator::handleGSLPointerConstruction(const
CXXConstructExpr *CCE) {
assert(isGslPointerType(CCE->getType()));
if (CCE->getNumArgs() != 1)
return;
- if (hasOrigin(CCE->getArg(0)))
- killAndFlowOrigin(*CCE, *CCE->getArg(0));
- else
+
+ if (isGslPointerType(CCE->getArg(0)->getType())) {
+ OriginTree *ArgTree = getTree(*CCE->getArg(0));
+ assert(ArgTree && "GSL pointer argument should have an origin tree");
+ // GSL pointer is constructed from another gsl pointer.
+ // Example:
+ // View(View v);
+ // View(const View &v);
+ if (ArgTree->getDepth() == 2)
----------------
Xazax-hun wrote:
I am not sure if having a hard-coded depth here is a good idea. Would this work
with nested views?
https://github.com/llvm/llvm-project/pull/168344
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits