-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++abi] Don't do pointer arithmetic on nullptr #119520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++abi] Don't do pointer arithmetic on nullptr #119520
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-libcxxabi Author: Vitaly Buka (vitalybuka) Changes
Fixes https://lab.llvm.org/buildbot/#/builders/85/builds/3200/steps/10/logs/stdio Full diff: https://github.com/llvm/llvm-project/pull/119520.diff 1 Files Affected:
diff --git a/libcxxabi/src/private_typeinfo.cpp b/libcxxabi/src/private_typeinfo.cpp
index 2f631041f74c94..8f6e8c6631de4c 100644
--- a/libcxxabi/src/private_typeinfo.cpp
+++ b/libcxxabi/src/private_typeinfo.cpp
@@ -593,7 +593,7 @@ __base_class_type_info::has_unambiguous_public_base(__dynamic_cast_info* info,
}
__base_type->has_unambiguous_public_base(
info,
- static_cast<char*>(adjustedPtr) + offset_to_base,
+ reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(adjustedPtr) + offset_to_base),
(__offset_flags & __public_mask) ? path_below : not_public_path);
}
|
The build bot link will expire. Can you replace this with concrete configuration? |
@vitalybuka Why don't we run into this issue in our |
I detected this after adding -fno-sanitize-recover=all to our bots, by default ubsan just prints a warning and moves on. |
@ldionne |
nullptr + offset
is possible after!is_virtual
branch.Detected with check-cxxabi on configured with: