Skip to content

SMT checker: Fix pop() assertion to match push/pop frame stack#16661

Closed
cuiweixie wants to merge 1 commit intoargotorg:developfrom
cuiweixie:bugfix/smtlib2-pop-frame-assert
Closed

SMT checker: Fix pop() assertion to match push/pop frame stack#16661
cuiweixie wants to merge 1 commit intoargotorg:developfrom
cuiweixie:bugfix/smtlib2-pop-frame-assert

Conversation

@cuiweixie
Copy link
Copy Markdown
Contributor

Summary

SMTLib2Commands::pop() used smtAssert(!m_commands.empty()) before reading the bookmarked deque size off m_frameLimits. That does not mirror what push() guarantees: push() always pushes the current deque size onto m_frameLimits, but the deque may legitimately remain empty across a bracket if no commands were flushed while the inner frame stayed open.

Fix

Replace the precondition with smtAssert(!m_frameLimits.empty()), which validates push/pop bookkeeping and still catches unbalanced pops when the stack is drained.

References

Touches libsmtutil/SMTLib2Interface.cpp only.

push() bookmarks the active command deque size in m_frameLimits; pop() must restore trailing commands relative to that limit. Checking m_commands.empty() could fail right after opening a stack frame during which nothing was asserted yet—the deque can legitimately remain empty across push/pop boundaries. Replace the guard with a non-empty m_frameLimits check instead so stray pop calls are still diagnosed without blocking valid checker sessions.
@cameel
Copy link
Copy Markdown
Collaborator

cameel commented May 3, 2026

Closing the PR because it ignores the mandatory disclosures we put into place recently.

@cameel cameel closed this May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants