reading SH ABI spec more, noting some curious similarities with the SysV/AMD64 ABI; wondering if related somehow, or if happened by chance.
This stuff is all common between most archs, with minor differences. 32-bit x86 is the main outlier that uses stack for all args.
-
-
I was more specifically thinking of its handling of passing and returning structures (decomposing into multiple registers, ...).
-
That's also pretty common.
-
ok. admittedly I prefer the simpler "pass in 1 or 2 registers, or pass by reference" strategy (ex: more like in the Win64 ABI).
-
Pass-by-ref for aggregate args has some fun consequences on UB: https://git.musl-libc.org/cgit/musl/commit/src/ipc/semctl.c?id=2b47a7aff24bbfbe7ba89fc6d542acc9f5493ae2 …
-
yeah. similar things can happen on Win64. have a few times seen cases where raw struct assignment crashes due to bad refs, ...
-
related: I have seen cases where returning a struct crashes at the 'return', because the caller didn't store the result anywhere
-
Rather because the caller called the function with a wrong declaration or wrong function pointer type.
-
... I have seen it happen apparently without a mismatched declaration; as MSVC can be a little hit-or-miss sometimes...
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.