Mercurial > pub > dyncall > dyncall
diff dyncall/dyncall_callvm_arm32_thumb.c @ 27:523c45dfa8fb
- refactored arm calling conventions' callvm code, so that the code that keeps
the caller from overwriting the return value on some platforms also works on
OpenBSD (before we casted the function pointer to have long long as return
type, to hint the caller that there is one, but that triggers an intentional
SIGABRT on OpenBSD for security reasons; now the decl reflects this, directly)
author | cslag |
---|---|
date | Tue, 15 Sep 2015 12:48:52 +0200 |
parents | 1c539fb1d2dd |
children | 67961454902b |
line wrap: on
line diff
--- a/dyncall/dyncall_callvm_arm32_thumb.c Sun Sep 13 16:52:53 2015 +0200 +++ b/dyncall/dyncall_callvm_arm32_thumb.c Tue Sep 15 12:48:52 2015 +0200 @@ -149,11 +149,7 @@ void dc_callvm_call_arm32_thumb(DCCallVM* in_self, DCpointer target) { DCCallVM_arm32_thumb* self = (DCCallVM_arm32_thumb*)in_self; - // This cast is needed in order for the cleanup code in the caller (this very function) to not - // overwrite and use r0 and r1, as we want to pass them back. On some platforms (FreeBSD/arm, Nintendo DS - // the compiler generates cleanup code that writes to those registers by assuming dcCall_arm32_thumb didn't - // use them. - ((DClonglong(*)(DCpointer, DCpointer, DCsize))&dcCall_arm32_thumb)(target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead)); + dcCall_arm32_thumb(target, dcVecData(&self->mVecHead), dcVecSize(&self->mVecHead)); }