Fix invocation of __invoke__()

__invoke__() expects a character, not a string, for the return type.
This commit is contained in:
Sergey Bugaev 2020-04-16 11:40:11 +03:00
parent a40bdc5357
commit 576490f5d9
2 changed files with 6 additions and 4 deletions

View File

@ -290,19 +290,21 @@
cls = class_getSuperclass(cls);
}
char rettype = [_signature methodReturnType][0];
if (blockClass)
{
struct Block_layout *block_layout = (struct Block_layout *)target;
__invoke__(block_layout->invoke, _retdata, _frame, [_signature frameLength], [_signature methodReturnType]);
__invoke__(block_layout->invoke, _retdata, _frame, [_signature frameLength], rettype);
}
else if ([_signature _stret])
{
char dummy[RET_SIZE_ARGS];
__invoke__(&objc_msgSend_stret, &dummy, _frame, [_signature frameLength], [_signature methodReturnType]);
__invoke__(&objc_msgSend_stret, &dummy, _frame, [_signature frameLength], rettype);
}
else
{
__invoke__(&objc_msgSend, _retdata, _frame, [_signature frameLength], [_signature methodReturnType]);
__invoke__(&objc_msgSend, _retdata, _frame, [_signature frameLength], rettype);
}
if (_retainedArgs)

View File

@ -4,7 +4,7 @@
// into retdata when returning from an invocation.
#define RET_SIZE_ARGS (4 * sizeof(int))
void __invoke__(void *send, void *retdata, marg_list args, size_t len, const char *rettype);
void __invoke__(void *send, void *retdata, marg_list args, size_t len, char rettype);
extern void _CF_forwarding_prep_0();
extern void _CF_forwarding_prep_1();