Skip to content

Allow C bool in block signatures - #890

Open
LucaCappelletti94 wants to merge 1 commit into
madsmtm:mainfrom
LucaCappelletti94:upstream/c-bool-blocks
Open

LucaCappelletti94 wants to merge 1 commit into
madsmtm:mainfrom
LucaCappelletti94:upstream/c-bool-blocks

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

Block typedefs with a C bool, 31 of them including nw_connection_receive_completion_t and DispatchDataApplier, cannot be constructed, because bool is neither EncodeArgument nor EncodeReturn while msg_send! reserves it for BOOL.

This adds EncodeBlockArgument and EncodeBlockReturn, which extend those traits with C bool and pointers to it, and bounds block2 on them. Blocks use the C ABI, so msg_send! and defined methods are unaffected. DispatchData::to_vec drops its u8 to bool transmute and keeps only a lifetime cast, since the generated applier is 'static despite DISPATCH_NOESCAPE.

Closes #752.

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.

Unsoundness in dispatch2

1 participant