Commit 3a795c66 by Nicolas Capens

Fix casting a pointer to an integer safely.

Only casting from an integer (any size) to a pointer using reinterpret_cast<> is well-defined. Casting a pointer to an integer needs a large enough integer. Bug 29894961 Change-Id: I51cf6923f4feeaf1860ca0565aa7d40b61918e67 Reviewed-on: https://swiftshader-review.googlesource.com/5750Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 19e433d1
......@@ -989,7 +989,7 @@ EGLImageKHR CreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLCl
}
#endif
GLuint name = reinterpret_cast<GLuint>(buffer);
GLuint name = static_cast<GLuint>(reinterpret_cast<uintptr_t>(buffer));
if(name == 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment