msan: define BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE in piex
authormtklein <mtklein@chromium.org>
Mon, 8 Feb 2016 17:35:05 +0000 (09:35 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 8 Feb 2016 17:35:05 +0000 (09:35 -0800)
commit6fd4e44e238755f8f81d007c8281c8fd63f03b3b
treeb423cfd590ca6496e74af0ef0ba8ffdd7b753175
parente365bfa1e7944a15505e7c00df71551e66204ac4
msan: define BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE in piex

This should assert(false) if we're in the error case of RangeCheckedBytePtr::extractBytes:

> #ifdef BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE
>   #define BREAK_IF_DEBUGGING() assert(false)
> #else
>   #define BREAK_IF_DEBUGGING() assert(true)
> #endif
  ...
> std::vector<unsigned char> RangeCheckedBytePtr::extractBytes(size_t pos, size_t length) const {
>   std::vector<unsigned char> result;
>   if (pos + length < pos /* overflow */ || remainingLength() < pos + length) {
>     BREAK_IF_DEBUGGING();
>     error_flag_ = RANGE_CHECKED_BYTE_ERROR_OVERFLOW;
>     return result;
>   }
  ...

BUG=skia:4903
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1678913002

Review URL: https://codereview.chromium.org/1678913002
gyp/piex.gyp