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

Fix codegen for buf #2217

Merged
merged 1 commit into from
May 16, 2022
Merged

Fix codegen for buf #2217

merged 1 commit into from
May 16, 2022

Conversation

viktormalik
Copy link
Contributor

@viktormalik viktormalik commented May 16, 2022

The second parameter of buf specifies the number of bytes to read. Codegen generates an icmp instruction to compare the supplied number with the maximum length. This instruction may introduce a problem when the supplied number is not a 64-bit integer, hence this commit adds a 'zext' typecast.

Fixes #2215. Also related to #2129 and #2182.

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

The second parameter of 'buf' specifies the number of bytes to read.
Codegen generates an 'icmp' instruction to compare the supplied number
with the maximum length. This instruction may introduce a problem when
the supplied number is not a 64-bit integer, hence this commit adds a
'zext' typecast.
@fbs fbs merged commit fafd595 into bpftrace:master May 16, 2022
@viktormalik viktormalik deleted the buf-codegen-fix branch May 25, 2022 08:18
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.

buf() print unsigned char * error
2 participants