[libcxx-commits] [libcxxabi] [libc++abi] Handle null pointer-to-object: Issue #64593 (PR #68076)

Mike Ash via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 4 07:42:11 PDT 2023


mikeash wrote:

libobjc has this wacky hand-written vtable: https://github.com/apple-oss-distributions/objc4/blob/objc4-906/runtime/objc-exception.mm#L183

It's mostly no-ops and relies on the fact that the calling conventions allow passing more parameters than the function actually consumes. There's one entry that actually does anything, which is `can_catch`, and that's unchanged here.

ARM64e ptrauth adds a wrinkle. Changing the signature of these methods will change the ptrauth discriminator, which will no longer match libobjc's hardcoded discriminators. That's not a big deal for `has_unambiguous_public_base`, as our version of that function just raises a fatal error anyway. Crashing due to a ptrauth mismatch would be slightly less friendly, but shouldn't happen anyway.

That's the only virtual method that changed, so I think we're all good here. libobjc might want to update its discriminator at some point, but that's just a nice-to-have, and it doesn't have to be coordinated with this change.

@rjmccall Anything I might have missed here?

https://github.com/llvm/llvm-project/pull/68076


More information about the libcxx-commits mailing list