[clang] [clang][dataflow] Fix casting in `ChromiumCheckModel`. (PR #101640)

2024-08-02 Thread Pasquale Riello via cfe-commits
https://github.com/Pask00 updated https://github.com/llvm/llvm-project/pull/101640 >From 7d1263ad9c72b638d4624173b128d24b1a4317a1 Mon Sep 17 00:00:00 2001 From: Pasquale Riello Date: Fri, 2 Aug 2024 08:59:07 + Subject: [PATCH 1/2] [clang][dataflow] Fix casting in `ChromiumCheckModel`. `get

[clang] [clang][dataflow] Fix casting in `ChromiumCheckModel`. (PR #101640)

2024-08-02 Thread Pasquale Riello via cfe-commits
https://github.com/Pask00 created https://github.com/llvm/llvm-project/pull/101640 `getDirectCallee()` may return a null pointer if the callee is not a `FunctionDecl` (for example when using function pointers), this requires to use `dyn_cast_or_null` instead of `dyn_cast`. >From 7d1263ad9c72b

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
https://github.com/Pask00 updated https://github.com/llvm/llvm-project/pull/99616 >From 0c26f09117baa36308bf58fed0ac40794b04ce74 Mon Sep 17 00:00:00 2001 From: Pasquale Riello Date: Fri, 19 Jul 2024 08:34:14 + Subject: [PATCH 1/3] [clang][dataflow] Handle CXXInheritedCtorInitExpr in Result

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
@@ -442,6 +442,46 @@ TEST_F(EnvironmentTest, CXXDefaultInitExprResultObjIsWrappedExprResultObj) { &Env.getResultObjectLocation(*DefaultInit->getExpr())); } +TEST_F(EnvironmentTest, ResultObjectLocationForInheritedCtorInitExpr) { + using namespace ast_matchers; +

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
https://github.com/Pask00 updated https://github.com/llvm/llvm-project/pull/99616 >From 0c26f09117baa36308bf58fed0ac40794b04ce74 Mon Sep 17 00:00:00 2001 From: Pasquale Riello Date: Fri, 19 Jul 2024 08:34:14 + Subject: [PATCH 1/2] [clang][dataflow] Handle CXXInheritedCtorInitExpr in Result

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
@@ -442,6 +442,46 @@ TEST_F(EnvironmentTest, CXXDefaultInitExprResultObjIsWrappedExprResultObj) { &Env.getResultObjectLocation(*DefaultInit->getExpr())); } +TEST_F(EnvironmentTest, ResultObjectLocationForInheritedCtorInitExpr) { + using namespace ast_matchers; +

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
@@ -442,6 +442,46 @@ TEST_F(EnvironmentTest, CXXDefaultInitExprResultObjIsWrappedExprResultObj) { &Env.getResultObjectLocation(*DefaultInit->getExpr())); } +TEST_F(EnvironmentTest, ResultObjectLocationForInheritedCtorInitExpr) { + using namespace ast_matchers; +

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
@@ -442,6 +442,46 @@ TEST_F(EnvironmentTest, CXXDefaultInitExprResultObjIsWrappedExprResultObj) { &Env.getResultObjectLocation(*DefaultInit->getExpr())); } +TEST_F(EnvironmentTest, ResultObjectLocationForInheritedCtorInitExpr) { + using namespace ast_matchers; +

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-24 Thread Pasquale Riello via cfe-commits
@@ -442,6 +442,46 @@ TEST_F(EnvironmentTest, CXXDefaultInitExprResultObjIsWrappedExprResultObj) { &Env.getResultObjectLocation(*DefaultInit->getExpr())); } +TEST_F(EnvironmentTest, ResultObjectLocationForInheritedCtorInitExpr) { + using namespace ast_matchers; +

[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

2024-07-19 Thread Pasquale Riello via cfe-commits
https://github.com/Pask00 created https://github.com/llvm/llvm-project/pull/99616 `CXXInheritedCtorInitExpr` is another of the node kinds that should be considered an "original initializer". An assertion failure in `assert(Children.size() == 1)` happens without this fix. >From 0c26f09117baa3