300 questions
0 votes
0 answers
46 views
Liveness Analysis doesn't produce expected result
First a bit of context. Consider the code: void foo(double* b){ int a = 100; a = 101; b[1] += b[a]; } I have a visitor, that has VisitArraySubscriptExpr(ASE), where I perform ...
1 vote
1 answer
45 views
Clang Static Analysis checker Assertion `Loc::isLocType(type)' failed
I'm writing a clang static analyzer checker for this class: class A { int member_; public: void set(const int& value); const int& get(); }; Real set implementation saves passed value to ...
1 vote
1 answer
47 views
Clang sa checker for get/set functions with reference types ("location cannot be a NonLoc")
I'm writing a clang static analyzer checker for a pair of functions that save the passed argument value and return it: void set(const int& value); const int& get(); Real set ...
0 votes
0 answers
72 views
vscode static c analyzer gives error when analyzing any file that includes windows.h
When ever I include windows.h when writing C, the analyzer would give me a thousand errors , I could just simply ignore them but the problem is that it won't detect any problem in the code I write I ...
0 votes
1 answer
75 views
LLVM Analyzer Garbage value
I work on a custom container and I manually allocate some heap memory: template<typename element_type> class MyClass{ element_type* m_data = nullptr; std::size_t rows, columns; // assume ...
1 vote
2 answers
4k views
How to write a If else condition in github action workflow yaml file?
Previously, I implemented a YAML workflow. It only works when both types of files are pushed simultaneously. If either a C or C++ file is pushed individually, the YAML workflow fails to execute. The ...
0 votes
0 answers
80 views
Get origin clang::ento::MemRegion from SVal of type clang::ento::nonloc::ConcreteInt
I would like to extract the relationships of the variables in a given C source file. More precisely, I would like to know which dependencies between the individual variables are generated via ...
1 vote
1 answer
142 views
Xcode analyzer is showing leak for CGPathRef when it's in a class instance method?
I have a class GraphicView that basically creates a UIView that uses a CAShapeLayer as its default layer object: GraphicView.h #import <UIKit/UIKit.h> @interface GraphicView : UIView { ...
1 vote
0 answers
107 views
use clang-query to match specified string
how should I use clang-query to match specified string souece code: int main() { __asm__ __volatile__("pause"); } I want to substituted "yield" for "pause" what I have ...
-1 votes
1 answer
215 views
clang static analyzer questions
I'm confused about making a decision. For example, when I wrote a code 'test.c' like this. int main(void){ int b = 2; int c = 0; int d = b/c; printf("d: %d\n&...
1 vote
1 answer
109 views
Iterate over constraints in Clang static Analyzer
I am developing a Clang static analyzer. In this analyzer, I need to iterate over the constraints in a RangedConstraintManager, but it seems this class is not public and I can't call its methods nor ...
2 votes
1 answer
359 views
How do I register my Clang Static Analyzer checker
I am fully aware that this question has previous answers. However, those answers are old and don't reflect what is happening in the current code base. I have followed the steps in this guide for ...
3 votes
2 answers
1k views
How to enable clang static analyzer flags from clang-tidy for alpha (experimental) checkers?
I'm trying to run the clang analyzer through its clang-tidy interface, but I need to pass the clang analyzer an additional flag. Specifically, I want to run an alpha checker for nondeterminism with ...
3 votes
1 answer
446 views
Is there a way for me to help Clang Static Analyzer understand global constant objects?
Background: because reasons, my code likes to return success/error-code values from its functions in the form of a (very lightweight) class-object. This works fine, however I'm having some ...
2 votes
1 answer
175 views
Can "unspecified order of evaluation" be detected with static analysis?
For most of my C++ projects, I strongly rely on static analysis to prevent bugprone code getting into the master branch. However, nothing seems to detect bugs caused by unspecified order of evaluation....