Skip to content
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

btf: Fix field resolution on structs with anon unions #2964

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

danobi
Copy link
Member

@danobi danobi commented Jan 27, 2024

Before, we failed to correctly resolve fields in structs whose first field(s) were anonymous unions. This is b/c we incorrectly early terminated the loop through the struct's members during resolution.

Fix by changing the incorrect return to a continue. Without the fix, the included test would fail trying to find c.

Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/reference_guide.md
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

Copy link
Contributor

@viktormalik viktormalik left a comment

Choose a reason for hiding this comment

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

LGTM, just a small note in tests.

tests/field_analyser.cpp Show resolved Hide resolved
Before, we failed to correctly resolve fields in structs whose first
field(s) were anonymous unions. This is b/c we incorrectly early
terminated the loop through the struct's members during resolution.

Fix by changing the incorrect return to a continue. Without the fix, the
included test would fail trying to find `c`.
@viktormalik viktormalik merged commit 6d1514f into bpftrace:master Jan 31, 2024
19 checks passed
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.

2 participants