util: Enable list_assert in debugoptimized builds
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 7 Jul 2022 21:59:48 +0000 (17:59 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 20 Jul 2022 23:37:13 +0000 (23:37 +0000)
commited06b3dd4917a13d2f547a649f3689f3f7fa5ef2
tree994a30921ac65dffa5fd0b8fae281318762dd84a
parent6139493ae384cfdc8452fabd41287ebd1d539f4c
util: Enable list_assert in debugoptimized builds

In debugoptimized builds, DEBUG is not set (and neither is NDEBUG). The
intention of NDEBUG is to disable assertions. As such, list assertions should be
gated on !NDEBUG as opposed to on DEBUG.

But assert() is already disabled in that case, so we don't need our own special
assert (Eric).

This would have caught an assertion failure (due to the wrong iterator used)
sooner for the Valhall compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17408>
src/util/list.h