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

Treat str() builtin's len parameter as int64 #2546

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

chenhengqi
Copy link
Contributor

The len parameter to str() should be treated as int64,
so that the LHS and RHS to IRBuilder::CreateICmp() is of
the same type. Otherwise, this would trigger an assertion
failure in the ICmpInst constructor.

Closes #2544.

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.

Looks good! Can you update CHANGELOG, too?

The len parameter to str() should be treated as int64,
so that the LHS and RHS to IRBuilder::CreateICmp() is of
the same type. Otherwise, this would trigger an assertion
failure in the ICmpInst constructor.

Closes bpftrace#2544.

Signed-off-by: Hengqi Chen <[email protected]>
@danobi danobi merged commit 31d421e into bpftrace:master Mar 31, 2023
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.

str function with len argument from same struct caused bpftrace segmentfault
3 participants