Handle copy on empty str/length zero data#235
Merged
avanhatt merged 4 commits intomodel-checking:main-152-2021-06-17from Jun 22, 2021
Merged
Handle copy on empty str/length zero data#235avanhatt merged 4 commits intomodel-checking:main-152-2021-06-17from
avanhatt merged 4 commits intomodel-checking:main-152-2021-06-17from
Conversation
c9911c1 to
5ac5b67
Compare
adpaco-aws
reviewed
Jun 22, 2021
Contributor
adpaco-aws
left a comment
There was a problem hiding this comment.
LGTM but we should keep track of the issue appearing in the intrinsic test and provide more information if possible.
Comment on lines
6
to
11
Contributor
There was a problem hiding this comment.
Open an issue regarding these failures.
Comment on lines
33
to
36
Contributor
There was a problem hiding this comment.
Does this fail for both cases or just one? This information would be useful for debugging slice processing.
Contributor
Author
There was a problem hiding this comment.
Both cases, added a comment to main saying that, thanks.
Contributor
There was a problem hiding this comment.
Suggested change
| // THIS CHUNK causes 3 failures | |
| // The chunk below causes 3 failures |
0dd2bb7 to
8b10ce2
Compare
adpaco-aws
approved these changes
Jun 22, 2021
adpaco-aws
pushed a commit
that referenced
this pull request
Jun 23, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Jul 2, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Jul 9, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Jul 15, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Jul 26, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Aug 2, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Aug 6, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Aug 17, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
adpaco-aws
pushed a commit
that referenced
this pull request
Aug 24, 2021
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
tedinski
pushed a commit
to tedinski/rmc
that referenced
this pull request
Apr 26, 2022
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
tedinski
pushed a commit
that referenced
this pull request
Apr 27, 2022
For consistency with LLVM semantics, only codegen an implicit memcpy when the length is nonzero.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Rust seems to use a special 0x1 pointer for the empty, length-zero string. C expects memcpy to take valid pointers even when the length of the copy is zero. So, to match LLVM semantics, we should only codegen a memcpy when the length is nonzero.
Resolved issues:
Resolves #234
Call-outs:
One of the test I adds fails not for the copy, but for some code to cast back to a ptr. This is a different issue.
Testing:
How is this change tested?
2 new tests, one for implicit copies and one with an intrinsic. Plus a fixme.
Is this a refactor change?
No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.