diff options
Diffstat (limited to 'clang-plugin/gerror-checker.cpp')
-rw-r--r-- | clang-plugin/gerror-checker.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang-plugin/gerror-checker.cpp b/clang-plugin/gerror-checker.cpp index 0717eff..46960b5 100644 --- a/clang-plugin/gerror-checker.cpp +++ b/clang-plugin/gerror-checker.cpp @@ -78,6 +78,7 @@ #include <clang/StaticAnalyzer/Core/Checker.h> #include <clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h> #include <clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h> +#include <clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h> #include "gerror-checker.h" #include "type-manager.h" @@ -704,7 +705,7 @@ GErrorChecker::_gerror_new (const Expr *call_expr, assert (this->_initialise_identifiers (ast_context)); DefinedOrUnknownSVal extent = - symbolic_allocated_region->getExtent (sval_builder); + getDynamicExtent (state, symbolic_allocated_region, sval_builder); const uint64_t _gerror_size = ast_context.getTypeSize (this->_gerror_type); DefinedOrUnknownSVal gerror_size = @@ -778,7 +779,7 @@ GErrorChecker::_assert_gerror_set (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_use_uninitialised, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_use_uninitialised, "Using uninitialized GError", error_node); #if 0 @@ -803,7 +804,7 @@ GErrorChecker::_assert_gerror_set (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_free_cleared, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_free_cleared, "Freeing non-set GError", error_node); #if 0 @@ -832,7 +833,7 @@ GErrorChecker::_assert_gerror_set (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_double_free, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_double_free, "Freeing already-freed GError", error_node); R->addRange (source_range); @@ -844,7 +845,7 @@ GErrorChecker::_assert_gerror_set (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_free_cleared, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_free_cleared, "Freeing non-set GError", error_node); R->addRange (source_range); @@ -925,7 +926,7 @@ GErrorChecker::_assert_gerror_unset (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_use_uninitialised, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_use_uninitialised, "Using uninitialized GError", error_node); #if 0 @@ -960,7 +961,7 @@ GErrorChecker::_assert_gerror_unset (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_overwrite_set, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_overwrite_set, "Overwriting already-set GError", error_node); R->addRange (source_range); @@ -973,7 +974,7 @@ GErrorChecker::_assert_gerror_unset (SVal error_location, ExplodedNode *error_node = context.generateErrorNode (state); this->_initialise_bug_reports (); - auto R = llvm::make_unique<BugReport> (*this->_overwrite_freed, + auto R = std::make_unique<PathSensitiveBugReport> (*this->_overwrite_freed, "Overwriting already-freed GError", error_node); R->addRange (source_range); |