Skip to content

Statically find msgSend functions on apple devices#15

Merged
madsmtm merged 1 commit into
masterfrom
static-msg-send
Sep 2, 2021
Merged

Statically find msgSend functions on apple devices#15
madsmtm merged 1 commit into
masterfrom
static-msg-send

Conversation

@madsmtm
Copy link
Copy Markdown
Owner

@madsmtm madsmtm commented Sep 1, 2021

The functions are found by looking at the Encode::ENCODING and size of the return type.

This ensures that we don't incur a performance overhead for that (though we probably didn't before anyways).

This is also more correct since it allows the following:

#[repr(transparent)]
struct Wrapper {
    inner: f32,
}
unsafe impl Encode for Wrapper {
    const ENCODING: Encoding<'static> = f32::ENCODING;
}

To use the correct msgSend implementation.

@madsmtm madsmtm added the enhancement New feature or request label Sep 1, 2021
This ensures that we don't incur performance overhead for that (though we probably didn't before anyways).

This is also more correct since it allows the following:
#[repr(transparent)]
struct Wrapper {
    inner: f32,
}
unsafe impl Encode for Wrapper {
    const ENCODING: Encoding<'static> = f32::ENCODING;
}
@madsmtm madsmtm merged commit de78ed4 into master Sep 2, 2021
@madsmtm madsmtm deleted the static-msg-send branch September 2, 2021 11:12
@madsmtm madsmtm mentioned this pull request Sep 5, 2021
80 tasks
@madsmtm madsmtm added this to the objc2 v0.3 milestone Apr 2, 2022
@madsmtm madsmtm added the I-unsound A soundness hole, or affecting soundness label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request I-unsound A soundness hole, or affecting soundness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant