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/from handle unsafe #1868

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Conversation

mlgiraud
Copy link
Contributor

Hi, another small api change. Currently the TryFrom trait is used to convert a uc_handle (a raw pointer) into a Unicorn struct. This is inherently unsafe and should be marked as such. Since the TryFrom trait cannot be unsafe, i introduced a new method from_handle that is marked as unsafe. This way the user is responsible for ensuring the safety of the program (we cannot guarantee this, since the uc_handle pointer is supplied by the user).

@mlgiraud mlgiraud changed the base branch from master to dev August 14, 2023 11:40
@mlgiraud mlgiraud mentioned this pull request Aug 16, 2023
@wtdcode wtdcode merged commit 8254890 into unicorn-engine:dev Aug 17, 2023
29 checks passed
@wtdcode
Copy link
Member

wtdcode commented Aug 17, 2023

Thanks!

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.

2 participants