Hash :
9092bdc7
Author :
Date :
2018-12-06T09:38:15
Fix crash in A4A opt-in/out logic.
The Device::match() method used to call the old ListOf<T>::match()
method with ListOf<T>::front(), assuming that front() always returned
a valid object reference. It did not (e.g. the default rule had a
wildcarded device that had no GPU).
A new ListOf<T>::match() was created (for the GPU case) that compares
to ListOf<T> objects. If either/both is wildcarded, true is quickly
returned. If both are not wildcarded, they will have one or more T's,
and these are iterated through (one in the new method, and one by
calling the old method).
During rule processing, it is safe to directly call the old method for
a Rule's ListOf<{Device|Application}>, and so the old method is retained.
Change-Id: Iea47075c38dc45eb32e1810c4997b8cfb2fe9ec3
Reviewed-on: https://chromium-review.googlesource.com/c/1365678
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>