commit | 2b8b74a77f11af072fa13bb720177af6df293b69 | [log] [tgz] |
---|---|---|
author | Pirama Arumuga Nainar <pirama@google.com> | Thu Feb 17 21:54:43 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Feb 17 21:54:43 2022 +0000 |
tree | bb916239325b6e7e80273659a64d87fc4286f727 | |
parent | 1e58e27ef388b863337a259336f066a3d9654c72 [diff] | |
parent | afc77a08b4c39a0ebcd226334945f2c46c78c945 [diff] |
Merge "Cast ifunc resolver's return type" am: afc77a08b4 Original change: https://android-review.googlesource.com/c/platform/bionic/+/1990810 Change-Id: I90524724a73647363c5ad4a76d2af61715894cfc
diff --git a/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp b/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp index 4b13eba..624ae74 100644 --- a/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp +++ b/tests/libs/dlopen_testlib_ifunc_variable_impl.cpp
@@ -43,11 +43,13 @@ extern "C" const char* v1 = "unset"; extern "C" const char* v2 = "set"; -extern "C" void* is_ctor_called_ifun() { - return g_flag == 0 ? &var_false : &var_true; +typedef const char* (*fn_ptr)(); + +extern "C" fn_ptr is_ctor_called_ifun() { + return (fn_ptr)(g_flag == 0 ? &var_false : &var_true); } -extern "C" void* foo_ifunc() { - char* choice = getenv("IFUNC_CHOICE"); - return choice == nullptr ? &v1 : &v2; +extern "C" fn_ptr foo_ifunc() { + char* choice = getenv("IFUNC_CHOICE"); + return (fn_ptr)(choice == nullptr ? &v1 : &v2); }