File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
include/clang/StaticAnalyzer/Core/PathSensitive Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,11 @@ class SMTConstraintManager : public clang::ento::SimpleConstraintManager {
278
278
if (const SymbolCast *SC = dyn_cast<SymbolCast>(Sym))
279
279
return canReasonAbout (SVB.makeSymbolVal (SC->getOperand ()));
280
280
281
+ // UnarySymExpr support is not yet implemented in the Z3 wrapper.
282
+ if (isa<UnarySymExpr>(Sym)) {
283
+ return false ;
284
+ }
285
+
281
286
if (const BinarySymExpr *BSE = dyn_cast<BinarySymExpr>(Sym)) {
282
287
if (const SymIntExpr *SIE = dyn_cast<SymIntExpr>(BSE))
283
288
return canReasonAbout (SVB.makeSymbolVal (SIE->getLHS ()));
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s \
2
+ // RUN: -analyzer-constraints=z3
3
+
4
+ // REQUIRES: Z3
5
+ //
6
+ // Previously Z3 analysis crashed when it encountered an UnarySymExpr, validate
7
+ // that this no longer happens.
8
+ //
9
+
10
+ // expected-no-diagnostics
11
+ int negate (int x , int y ) {
12
+ if ( ~(x && y ))
13
+ return 0 ;
14
+ return 1 ;
15
+ }
You can’t perform that action at this time.
0 commit comments