Skip to content

Variadic args/va_arg: handle unexpected va_list types #7711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tautschnig
Copy link
Collaborator

Our regression test has void* lists when we'd expected void**. This, however, went unnoticed as we only tried to access the first element. Attempts to access the second element would have been misaligned, and failed an invariant as of 35cc503 (we don't handle pointer arithmetic over void pointers in the back-end anymore).

We now make sure that we always increment by size-of-void*.

Fixes: #7706

  • 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.

@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9c7bccc) 79.66% compared to head (f755e00) 79.66%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7711   +/-   ##
========================================
  Coverage    79.66%   79.66%           
========================================
  Files         1682     1682           
  Lines       195377   195384    +7     
========================================
+ Hits        155641   155647    +6     
- Misses       39736    39737    +1     

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

@tautschnig tautschnig force-pushed the bugfixes/7706-va-start branch from 790222a to f755e00 Compare February 13, 2024 11:31
Our regression test has `void*` lists when we'd expected `void**`. This,
however, went unnoticed as we only tried to access the first element.
Attempts to access the second element would have been misaligned, and
failed an invariant as of 35cc503 (we don't handle pointer arithmetic
over void pointers in the back-end anymore).

We now make sure that we always increment by size-of-`void*`.

Fixes: diffblue#7706
@tautschnig tautschnig force-pushed the bugfixes/7706-va-start branch from f755e00 to d05703f Compare May 8, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong result using __va_list_tag_type with multiple arguments
3 participants