Skip to content

Use memmove in tic_api_memcpy - #2417

Merged
nesbox merged 1 commit into
nesbox:mainfrom
mbikovitsky:patch-1
Dec 26, 2023
Merged

nesbox merged 1 commit into
nesbox:mainfrom
mbikovitsky:patch-1

Conversation

@mbikovitsky

Copy link
Copy Markdown
Contributor

Calling memcpy with overlapping source and destination buffers is undefined behaviour. For example, see #1875. But, users of the TIC-80 memcpy function probably expect it to work fine even with overlapping buffers. Thus: memmove.

@joshgoebel joshgoebel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

https://stackoverflow.com/a/53486461

Looks like a positive change to me.

@nesbox nesbox linked an issue Dec 26, 2023 that may be closed by this pull request
@nesbox
nesbox merged commit a3132cb into nesbox:main Dec 26, 2023
@mbikovitsky
mbikovitsky deleted the patch-1 branch December 26, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

memcpy glitches out in the web build

3 participants