diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-08-23 14:59:20 -0500 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2018-08-23 12:59:20 -0700 |
commit | 408bccf70b41b1f41c8be04ffe7f7002fb57e182 (patch) | |
tree | a9a11516fd218ed9c8b99a8c289e3f39b9f82207 /src/theory/quantifiers/ematching/trigger.cpp | |
parent | 4dc48596188c0550e625434cdd893d909810f9de (diff) |
Fixing some coverity warnings (#2357)
Diffstat (limited to 'src/theory/quantifiers/ematching/trigger.cpp')
-rw-r--r-- | src/theory/quantifiers/ematching/trigger.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/theory/quantifiers/ematching/trigger.cpp b/src/theory/quantifiers/ematching/trigger.cpp index 3615ef6f4..b50deea11 100644 --- a/src/theory/quantifiers/ematching/trigger.cpp +++ b/src/theory/quantifiers/ematching/trigger.cpp @@ -838,6 +838,7 @@ Node Trigger::getInversion( Node n, Node x ) { return x; }else if( n.getKind()==PLUS || n.getKind()==MULT ){ int cindex = -1; + bool cindexSet = false; for( unsigned i=0; i<n.getNumChildren(); i++ ){ if( !quantifiers::TermUtil::hasInstConstAttr(n[i]) ){ if( n.getKind()==PLUS ){ @@ -859,12 +860,15 @@ Node Trigger::getInversion( Node n, Node x ) { } x = Rewriter::rewrite( x ); }else{ - Assert( cindex==-1 ); + Assert(!cindexSet); cindex = i; + cindexSet = true; } } - Assert( cindex!=-1 ); - return getInversion( n[cindex], x ); + if (cindexSet) + { + return getInversion(n[cindex], x); + } } return Node::null(); } |