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 variable is assigned twice successively. #4631

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

Bug: a variable is assigned twice successively. #4631

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

Comments

@ustchcs-bugfinder
Copy link

ustchcs-bugfinder commented Aug 13, 2020

m_last_index = 0;

     ...
     if (m_hill_climb) {
            /**
               Give preference to cores that have large minimal values.
            */
            sort_assumptions(asms);              
            m_last_index = std::min(m_last_index, asms.size()-1);            //assigned for the first time
            m_last_index = 0;                                                                    //assigned twice
            unsigned index = m_last_index>0?m_last_index-1:0;
            m_last_index = 0;
            bool first = index > 0;
            SASSERT(index < asms.size() || asms.empty());
            IF_VERBOSE(10, verbose_stream() << "start hill climb " << index << " asms: " << asms.size() << "\n";);
            while (index < asms.size() && is_sat == l_true) {
                while (!first && asms.size() > 20*(index - m_last_index) && index < asms.size()) {
                    index = next_index(asms, index);
                }
                first = false;
                m_last_index = index;
                is_sat = check_sat(index, asms.c_ptr());
            }            
        }
...

Reported by: USTCHCS Analysis Toolsuite Bugfinder
(bugfinder-2.7: A variable should not be assigned values twice successively.)

NikolajBjorner added a commit that referenced this issue Aug 13, 2020
Signed-off-by: Nikolaj Bjorner <[email protected]>
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

2 participants