Fix for not wrapping a function for a different Wrappee.
In cases, like in OpenCL, the main library (OpenCL) acts as a wrapper for other implementations (libamdocl64.so). In this case both have same function names implemented. If we wrap OpenCL functions with gotcha which dynamically loads libamdocl64.so with same function name, we should not return a wrapper meant to intercept OpenCL. So we should check if the wrapper given to the caller of dlsym is for the same wrappee as requested by the caller.
Fixes #146. @bertwesarg So essentially, what was happening is
When u call gotcha_wrap, u wrapped the clGetExtensionFunctionAddress function within libOpenCL.so.
Now the OpenCL, dlopen libamdocl64.so and did a dlsym for clGetExtensionFunctionAddress. GOTCHA was returning the wrapper for libOpenCL.so.
The fix essentially adds a check to make sure we return the wrapper for the function we wrapped. Let me know if this works.
Pull Request Test Coverage Report for Build 9297202239
Details
- 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 100.0%
| Totals | |
|---|---|
| Change from base Build 9297145788: | 0.0% |
| Covered Lines: | 1008 |
| Relevant Lines: | 1008 |
💛 - Coveralls
@bertwesarg did u get a change to look at this PR? Does this cover all the cases you need for #146
I will give this PR a last test in my use case and will approve then
I will give this PR a last test in my use case and will approve then
LGTM