Repository navigation
goto_inline: handle arguments of a type that differs from the parameter's - #9453
Open
tautschnig wants to merge 1 commit into
Open
tautschnig wants to merge 1 commit into
tautschnig wants to merge 1 commit into
Conversation
tautschnig
requested review from
feliperodri,
kroening,
peterschrammel and
remi-delmas-3000
as code owners
November 12, 2026 00:36
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9453 +/- ##
========================================
Coverage 81.29% 81.30%
========================================
Files 1725 1725
Lines 191680 191703 +23
Branches 73 73
========================================
+ Hits 155835 155866 +31
+ Misses 35845 35837 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tautschnig
force-pushed
the
up/inline
branch
from
November 27, 2026 14:30
dd11330 to
8908b53
Compare
The inliner failed an UNREACHABLE when an argument could not be converted to the type of the parameter it binds to: it converted only pointers to pointers, arrays to pointers, and integers or Booleans to integers or Booleans. Other mismatches arise whenever a function is called without a prototype in scope, e.g. with an enum or floating-point argument, so goto-instrument --inline aborted on such programs. Symbolic execution handles the same calls in goto_symext::parameter_assignments: it reinterprets the bits of integer, bit-field, enum, Boolean, pointer and union arguments bound to parameters of those types, and rejects any other mismatch. Do the same in the inliner for the cases it did not handle so far, so that inlining does not change the verification result, and use a non-deterministic value, with a warning, for the mismatches that symbolic execution rejects, as the inliner already does for a missing argument. DFCC's loop assigns inference inlines the callees of a function with loop contracts before the function's calls are instrumented, and adds a placeholder argument for the write set parameter of callees that have already been instrumented. Without the placeholder, the arguments bind to the wrong parameters, which so far made the inliner fail an invariant. As the inliner now tolerates the mismatch, a missing placeholder would no longer be noticed by any regression test. Tests: - goto-instrument/inline_19 checks that an enum argument gives the same result as without inlining, and that a double argument bound to an int parameter is replaced by a non-deterministic value; - contracts-dfcc/loop_assigns_inference_write_set_placeholder makes the shifted arguments observable: without the placeholder, &a binds to the write set parameter of printf and 0 to p, so that the inferred loop assigns miss a and the assigns check of *p fails. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
tautschnig
force-pushed
the
up/inline
branch
from
November 27, 2026 14:35
8908b53 to
97ebcce
Compare
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.
Depends-on: #9452
The inliner failed an UNREACHABLE when an argument could not be converted
to the type of the parameter it binds to: it converted only pointers to
pointers, arrays to pointers, and integers or Booleans to integers or
Booleans. Other mismatches arise whenever a function is called without a
prototype in scope, e.g. with an enum or floating-point argument, so
goto-instrument --inline aborted on such programs.
Symbolic execution handles the same calls in
goto_symext::parameter_assignments: it reinterprets the bits of integer,
bit-field, enum, Boolean, pointer and union arguments bound to parameters
of those types, and rejects any other mismatch. Do the same in the
inliner, so that inlining does not change the verification result, and
use a non-deterministic value, with a warning, for the mismatches that
symbolic execution rejects, as the inliner already does for a missing
argument.
DFCC's loop-assigns inference reaches the latter: it inlines the callees
of a function with loop contracts before that function's calls are
instrumented, so a callee that already has its write set parameter is
inlined against the original arguments. For a variadic callee, a
variadic argument then binds to a declared parameter.
Tests:
without inlining, and a double argument bound to an int parameter is
replaced by a non-deterministic value;
Co-authored-by: Kiro kiro-agent@users.noreply.github.com