Fence has a second base class with virtual functions, but its first base does not. In "static VkResult Create(...), when assigning the handle via: *outObject = *object; since this is code run in the context of the first base class, the address returned is offset by sizeof the vtable pointer from the second base class (8 bytes on x64). Problem is that the Cast overload for Fence does a simple reinterpret_cast of this stored pointer back to Fence*, without the offset being taken into account. The fix is to simply first cast the stored pointer back to the first base class type, and then static_cast it to the derived Fence type. Bug: b/117835459 Change-Id: Ieb2856320e996a5ad5d9e69aad5e01cfaee1cd9e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31988Reviewed-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| Android.mk | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| SwiftShader.sln | Loading commit data... |