Repository navigation
DFCC: match write set arguments to parameters when inferring loop assigns - #9578
Open
tautschnig wants to merge 1 commit into
Open
tautschnig wants to merge 1 commit into
tautschnig wants to merge 1 commit into
Conversation
…igns Since diffblue#9452, DFCC adds the write set as the first parameter of each function it instruments, and as the first argument of the calls in an instrumented body of the functions it instruments. It does so one function at a time, while inferring the assigns clauses of the loops of each function on a copy of its body with all calls inlined. Inlining binds arguments to parameters in order, and then reaches calls whose arguments do not match the callee's parameters: - an instrumented body passes the write set to a function that is not instrumented yet: each argument binds to the parameter before its own; - a body that is not instrumented yet calls a function that is: each argument binds to the parameter after its own. Upstream's placeholders covered the second case for the calls in the copy itself only. Either case aborts the inliner when an argument cannot be converted to the type of the parameter it binds to (the invariant in goto_inlinet::parameter_assignments), and otherwise infers the writes of a callee from the wrong arguments. write_set_argumentst now makes the calls match, in the copy and, until the inference is done, in the bodies of the functions that inlining reaches from it: it adds a nil argument for a write set parameter without an argument, and removes a write set argument without a parameter. The functions of the cprover_contracts library, whose first parameter is a write set of their own, keep their arguments. Which case arises depends on the order in which DFCC instruments the functions, which is the order of the identifiers' numbers in the string table. The tests loop_assigns_inference-instrumented-caller and -callee hit each case; both abort on develop. Their loops read x, which makes x a candidate target of the inference. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
tautschnig
requested review from
feliperodri,
kroening,
peterschrammel and
remi-delmas-3000
as code owners
November 25, 2026 23:12
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9578 +/- ##
========================================
Coverage 81.29% 81.30%
========================================
Files 1725 1725
Lines 191680 191729 +49
Branches 73 73
========================================
+ Hits 155832 155886 +54
+ Misses 35848 35843 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #9452, DFCC adds the write set as the first parameter of each function it instruments, and as the first argument of the calls in an instrumented body of the functions it instruments. It does so one function at a time, while inferring the assigns clauses of the loops of each function on a copy of its body with all calls inlined. Inlining binds arguments to parameters in order, and then reaches calls whose arguments do not match the callee's parameters:
write_set_argumentst now makes the calls match, in the copy and, until the inference is done, in the bodies of the functions that inlining reaches from it: it adds a nil argument for a write set parameter without an argument, and removes a write set argument without a parameter. The functions of the cprover_contracts library, whose first parameter is a write set of their own, keep their arguments.
Which case arises depends on the order in which DFCC instruments the functions, which is the order of the identifiers' numbers in the string table. The tests loop_assigns_inference-instrumented-caller and -callee hit each case; both abort on develop. Their loops read x, which makes x a candidate target of the inference.