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 of constant byte slices #2663

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

zhassan-aws
Copy link
Contributor

Description of changes:

Codegen of constant byte slices was producing an array expression (which is a temporary) and returning a pointer to it, resulting in a spurious failure when trying to access the array through the pointer. This PR updates codegen to perform an allocation instead, which is how other slice cases (e.g. string slice) are handled.

Resolved issues:

Resolves #2656
Resolves #2066

Related RFC:

Optional #ISSUE-NUMBER.

Call-outs:

Testing:

  • How is this change tested? Added both the original test and the reduced version to the regressions

  • Is this a refactor change? No

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@zhassan-aws zhassan-aws requested a review from a team as a code owner August 8, 2023 01:08
Copy link
Contributor

@feliperodri feliperodri left a comment

Choose a reason for hiding this comment

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

LGTM.

@zhassan-aws zhassan-aws merged commit 9a9e815 into model-checking:main Aug 8, 2023
@zhassan-aws zhassan-aws deleted the iss2656 branch August 8, 2023 16:24
@adpaco-aws adpaco-aws mentioned this pull request Aug 9, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
2 participants