Skip to content

Refactor entry point validation towards symex-callers#8782

Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-1847-entry-point-logic
Open

Refactor entry point validation towards symex-callers#8782
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:fix-1847-entry-point-logic

Conversation

@tautschnig
Copy link
Collaborator

We can detect the absence of an entry point much earlier and do not need to perform unnecessary work before inevitably failing.

Fixes: #1847

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig force-pushed the fix-1847-entry-point-logic branch 2 times, most recently from e119656 to c0d7491 Compare December 1, 2025 18:09
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.01%. Comparing base (5719027) to head (5b8c6ac).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8782      +/-   ##
===========================================
- Coverage    80.02%   80.01%   -0.01%     
===========================================
  Files         1700     1700              
  Lines       188345   188354       +9     
  Branches        73       73              
===========================================
- Hits        150716   150711       -5     
- Misses       37629    37643      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tautschnig tautschnig marked this pull request as ready for review December 1, 2025 19:06
@tautschnig tautschnig force-pushed the fix-1847-entry-point-logic branch from c0d7491 to 7f3aa29 Compare March 10, 2026 12:19
Copilot AI review requested due to automatic review settings March 10, 2026 12:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors entry point validation by moving the check for the existence of an entry point function from deep inside goto_symext::initialize_entry_point_state() to the caller sites. Previously, a std::out_of_range exception was caught and re-thrown as an unsupported_operation_exceptiont; now callers validate the entry point exists before invoking symex, and the function documents this as a precondition.

Changes:

  • Removed the try/catch block in initialize_entry_point_state() and added a precondition comment, changing the variable from a pointer to a reference.
  • Added entry point existence validation in four caller sites (multi_path_symex_only_checker, single_path_symex_only_checker, single_loop_incremental_symex_checker, and their respective methods).
  • Extended lazy_goto_functions_mapt::can_produce_function() to also check the symbol table for functions with code type and non-nil value.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/goto-symex/symex_main.cpp Removed try/catch, changed pointer to reference, added precondition documentation
src/goto-symex/goto_symex.h Added \pre documentation for entry point existence requirement
src/goto-checker/single_path_symex_only_checker.cpp Added entry point validation before calling symex
src/goto-checker/single_loop_incremental_symex_checker.cpp Added entry point validation before calling symex
src/goto-checker/multi_path_symex_only_checker.cpp Added entry point validation before calling symex
jbmc/src/java_bytecode/lazy_goto_functions_map.h Extended can_produce_function to also check symbol table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

We can detect the absence of an entry point much earlier and do not need
to perform unnecessary work before inevitably failing.

This also fixes a bug where `can_produce_function` did not accurately
reflect what functions could be produced.

Fixes: diffblue#1847
Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

A missing entry point should be reported early

3 participants