Commit 232d009d by Shahbaz Youssefi Committed by Commit Bot

Fix string literal comparison in validation

String literals shouldn't be compared by pointer, especially if the literal is declared in a header (so the two pointers can come from different translation units, because the string literal might have a different copy in each). Use strcmp instead. Bug: angleproject:4175 Change-Id: I6002ccb185f48928b67ce8a7b3508e427761a8c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940568 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 33adad19
......@@ -324,9 +324,9 @@ ANGLE_INLINE bool ValidateDrawBase(Context *context, PrimitiveMode mode)
// All errors from ValidateDrawStates should return INVALID_OPERATION except Framebuffer
// Incomplete.
bool isFramebufferIncomplete = strcmp(errorMessage, err::kDrawFramebufferIncomplete) == 0;
GLenum errorCode =
(errorMessage == err::kDrawFramebufferIncomplete ? GL_INVALID_FRAMEBUFFER_OPERATION
: GL_INVALID_OPERATION);
isFramebufferIncomplete ? GL_INVALID_FRAMEBUFFER_OPERATION : GL_INVALID_OPERATION;
context->validationError(errorCode, errorMessage);
return false;
}
......
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