[scudo] Fix String DCHECK
authorKostya Kortchinsky <kostyak@google.com>
Fri, 4 Jun 2021 20:38:26 +0000 (13:38 -0700)
committerKostya Kortchinsky <kostyak@google.com>
Fri, 4 Jun 2021 20:41:59 +0000 (13:41 -0700)
commit5019b0a56588fc13e6a37c49e22a812afe6c4416
tree55561e55ba586790a32bd68c6179beeb272fe478
parentefea1b17824377c274abe5600d7d973087553e23
[scudo] Fix String DCHECK

This resolves an issue tripping a `DCHECK`, as I was checking for the
capacity and not the size. We don't need to 0-init the Vector as it's
done already, and make sure we only 0-out the string on clear if it's
not empty.

Differential Revision: https://reviews.llvm.org/D103716
compiler-rt/lib/scudo/standalone/string_utils.h