We were just combing through possible changes that might have affected
the attached bug, this popped out as pretty obviously unsafe.
This doesn't explain the Chrome bug...
SkAutoTMalloc and SKAutoSTMalloc are separate types. :(
The new test fails and crashes before, passes after.
Change-Id: I033f488a7f644b7a70e612c8535fedfac35c76db
Reviewed-on: https://skia-review.googlesource.com/11797
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Ensures that ".get()" always returns null when a container is empty.
Also ensures consistent assert behavior for array counts.
There are still differences in that the malloc variants take a size_t
and the arrays take an int, and that SkAutoSTMalloc defaults to the
stack-allocated buffer wheras the other containers default to null.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084213003
Review-Url: https://codereview.chromium.org/2084213003