Skip to content

Commit 8ff3764

Browse files
jll63claude
andcommitted
Fix function-type mismatch in dynamic_loading test
main.cpp loads and calls method_get_ids/overrider_get_ids through policy_ids_fn = const void**(), but the exported functions returned const void*. The pointer reinterpretation is harmless at the ABI level, so the test passes everywhere except the clang UBSan job, where -fsanitize=function traps the call through the mismatched function-pointer type and aborts. Declare the exports to return const void** to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f1adf10 commit 8ff3764

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

test/dynamic_loading/method.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ BOOST_OPENMETHOD_OVERRIDE(
4040

4141
extern "C" {
4242

43-
BOOST_SYMBOL_EXPORT const void* method_get_ids() {
43+
BOOST_SYMBOL_EXPORT const void** method_get_ids() {
4444
return get_ids();
4545
}
4646

test/dynamic_loading/overrider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ BOOST_OPENMETHOD_CLASSES(Animal, Dog);
3131

3232
extern "C" {
3333

34-
BOOST_SYMBOL_EXPORT const void* overrider_get_ids() {
34+
BOOST_SYMBOL_EXPORT const void** overrider_get_ids() {
3535
return get_ids();
3636
}
3737

0 commit comments

Comments
 (0)