From 6c98fdf78af4d1e051f149106bd45a011279ebda Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 13 Jul 2015 17:34:30 +0300 Subject: Add ability to detect return from operator new as non null pointer. It allow this example: int ptr = new int[10]; // paranucker work with ptr here as with non null pointer --- src/analysis/expression.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/analysis/expression.cpp b/src/analysis/expression.cpp index 54d73c2..2162666 100644 --- a/src/analysis/expression.cpp +++ b/src/analysis/expression.cpp @@ -775,7 +775,9 @@ bool handleSetVarToFunction(const std::string &var, return false; if (findTreeListPurpose(static_cast(func->functionType->attribute), - "returns_nonnull")) + "returns_nonnull") || + func->label == "operator new" || + func->label == "operator new []") { // function have attribute returns_nonnull. This mean result cant be null addNonNullVar(wo, var); } -- cgit v1.2.3-60-g2f50