You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe my initial implementation of overloading the intrinsics had that feature, but after discussing with @jrtc27 we decided to have __builtin_cheri_cap_build always return a void *, but TBH I can't remember exactly why. I believe the rationale was that you should only be using buildcap to add a tag to some raw bit pattern (which cannot be a valid pointer by definition).
Things get a little bit ambiguous when using buildcap is used for unsealing, in which case you could have a tagged input argument.
The point is the input is a raw bag of bits that shouldn't be a valid pointer and certainly shouldn't be a valid typed pointer, so is always a uintcap_t. The type of the authorising capability is also not meaningful when it comes to the output. So there's no input type to propagate to the output, which means you get a void * __capability.
Unlike other similar CHERI builtins,
__builtin_cheri_cap_build
always returnsvoid * __capability
, even if passeduintcap_t
: https://cheri-compiler-explorer.cl.cam.ac.uk/z/x5s45MThe text was updated successfully, but these errors were encountered: