Skip to content

Fix builtin function return hidden flag inconsistency#8800

Open
tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:fix-5207-hidden
Open

Fix builtin function return hidden flag inconsistency#8800
tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:fix-5207-hidden

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

Function returns for built-in functions now correctly match their function call hidden flag. This is done by symex storing the combined hidden flag in call frame.

Co-authored-by: Kiro autonomous agent

Fixes: #5207

  • 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-5207-hidden branch 2 times, most recently from 9f1f36b to 64d8732 Compare December 9, 2025 18:29
@tautschnig tautschnig marked this pull request as ready for review December 9, 2025 18:46
@codecov

codecov Bot commented Dec 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.68%. Comparing base (02c2769) to head (219e49a).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8800      +/-   ##
===========================================
- Coverage    80.69%   80.68%   -0.01%     
===========================================
  Files         1714     1714              
  Lines       189597   189598       +1     
  Branches        73       73              
===========================================
- Hits        152987   152983       -4     
- Misses       36610    36615       +5     

☔ View full report in Codecov by Harness.
📢 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 force-pushed the fix-5207-hidden branch 2 times, most recently from 08b0ca8 to c17ccd5 Compare March 10, 2026 22:12
Copilot AI review requested due to automatic review settings March 10, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes an inconsistency where built-in function return events could have a different hidden flag than their corresponding function call, by storing the combined hidden flag on the call frame and adding regression coverage for JSON/XML UIs.

Changes:

  • Store the combined hidden value on the call frame for later use by return handling.
  • Add a regression test that asserts hidden="false" / "hidden": false for both function-call and function-return steps for malloc in XML and JSON UIs.

Reviewed changes

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

File Description
src/goto-symex/symex_function_call.cpp Persists the combined hidden flag on the call frame to keep call/return hidden status consistent.
regression/cbmc/builtin-function-hidden-flag/test.c Adds a minimal program that triggers a built-in (malloc) call and a failing assertion to produce a trace.
regression/cbmc/builtin-function-hidden-flag/test.desc Adds JSON-UI regression expectations for hidden: false on call and return steps.
regression/cbmc/builtin-function-hidden-flag/test_xml.desc Adds XML-UI regression expectations for hidden="false" on call and return steps.

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

Comment thread regression/cbmc/builtin-function-hidden-flag/test_xml.desc Outdated
Comment thread regression/cbmc/builtin-function-hidden-flag/test.desc Outdated
A function-return event could be hidden while its matching function-call
event was not, making it hard to filter internal trace steps yet still pair
calls with returns (issue diffblue#5207). The function-call event uses the combined
caller/callee hidden flag, whereas the function-return event read
frame.hidden_function (the callee's own is_hidden()), so the two disagreed
for a hidden function invoked from a visible caller.

Store the call event's hidden flag separately on the frame
(hidden_function_call) and reuse it for the matching function-return event,
leaving frame.hidden_function to drive body/internal-step hiding. Call and
return now stay consistent without un-hiding the body of a hidden function:
its CPROVER_HIDE-marked steps remain hidden regardless of the caller.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>

Fixes: diffblue#5207
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.

Built-in function returns hidden in json and xml traces

3 participants