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

CLEANUP: Silence UBSAN message #1275

Closed
wants to merge 1 commit into from
Closed

Conversation

mgondan
Copy link
Sponsor Contributor

@mgondan mgondan commented May 4, 2024

Silences the following warning:

/.../swipl-devel/src/pl-thread.c:7649:5: runtime error: null pointer passed as argument 1, which is declared to never be null
/.../swipl-devel/src/pl-thread.c:7649:5: runtime error: null pointer passed as argument 2, which is declared to never be null

In the call that raises the error, arg1 and arg2 from a memcpy(arg1, arg2, bytes) are NULL, but bytes is also 0.

Silences the following warning:

/.../swipl-devel/src/pl-thread.c:7649:5: runtime error: null pointer passed as argument 1, which is declared to never be null
/.../swipl-devel/src/pl-thread.c:7649:5: runtime error: null pointer passed as argument 2, which is declared to never be null

It turns out that whenever args 1 and 2 are NULL, bytes is also 0.
@mgondan mgondan marked this pull request as ready for review May 4, 2024 14:03
@mgondan
Copy link
Sponsor Contributor Author

mgondan commented May 6, 2024

I see it has already been implemented. Closing this PR.

@mgondan mgondan closed this May 6, 2024
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.

None yet

1 participant