Add debug macro for returning on assert.
While in general one should strive to never hit an assert, and thus we
should not worry about what happens in release mode when the condition
is false, there are cases in which it becomes very hard to prove that a
condition will always be true. For instance when another layer is
responsible for validation, but the code experiences a lot of change,
it could inadvertently expose an untested bad edge case which is only
detected much later. For these cases, it is wise to still perform a
less harmful action than just continue.
The ASSERT_OR_RETURN macro will cause a return from the calling
function when the condition is false.
Bug b/73656151
Change-Id: I36953bb5c477ecca67647ae1a7e2fb97e7e4fca6
Reviewed-on: https://swiftshader-review.googlesource.com/17428Tested-by:
Nicolas Capens <nicolascapens@google.com>
Reviewed-by:
Alexis Hétu <sugoi@google.com>
Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Showing
Please
register
or
sign in
to comment