Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: a break statement is missing (very likely) #4643

Closed
ustchcs-bugfinder opened this issue Aug 17, 2020 · 0 comments
Closed

Bug: a break statement is missing (very likely) #4643

ustchcs-bugfinder opened this issue Aug 17, 2020 · 0 comments

Comments

@ustchcs-bugfinder
Copy link

 case 0:
            if (j && !j->in_region())
                m_justifications.push_back(j);
            TRACE("mk_clause", tout << "empty clause... setting conflict\n";);
            set_conflict(j == nullptr ? b_justification::mk_axiom() : b_justification(j));
            SASSERT(inconsistent());
            return nullptr;
        case 1:
            if (j && !j->in_region())
                m_justifications.push_back(j);
            assign(lits[0], j);
            inc_ref(lits[0]);
            return nullptr;
        case 2:
            if (use_binary_clause_opt(lits[0], lits[1], lemma)) {
                literal l1 = lits[0];
                literal l2 = lits[1];
                inc_ref(l1);
                inc_ref(l2);
                m_watches[(~l1).index()].insert_literal(l2);
                m_watches[(~l2).index()].insert_literal(l1);
                if (get_assignment(l2) == l_false) {
                    assign(l1, b_justification(~l2));
                }
                m_clause_proof.add(l1, l2, k, j);
                m_stats.m_num_mk_bin_clause++;
                return nullptr;
            }                                                        // break?? or fall-through???
        default: {
            m_stats.m_num_mk_clause++;

Reported by: USTCHCS Analysis Toolsuite Bugfinder
(bugfinder-9.3: Each non-empty case of switch statement should be ended with an unconditional break, throw or return statement.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant