Commit 8cd4f841 authored by yzshen@chromium.org's avatar yzshen@chromium.org

More clear comment for ValidateStructHeader.

BUG=None
TEST=None
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/328183002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276546 0039d316-1c4b-4281-b951-d872f2087c98
parent 843ad95a
...@@ -84,6 +84,8 @@ bool ValidateStructHeader(const void* data, ...@@ -84,6 +84,8 @@ bool ValidateStructHeader(const void* data,
uint32_t min_num_bytes, uint32_t min_num_bytes,
uint32_t min_num_fields, uint32_t min_num_fields,
BoundsChecker* bounds_checker) { BoundsChecker* bounds_checker) {
assert(min_num_bytes >= sizeof(StructHeader));
if (!IsAligned(data)) { if (!IsAligned(data)) {
ReportValidationError(VALIDATION_ERROR_MISALIGNED_OBJECT); ReportValidationError(VALIDATION_ERROR_MISALIGNED_OBJECT);
return false; return false;
......
...@@ -71,6 +71,7 @@ inline void Decode(T* obj, std::vector<Handle>* handles) { ...@@ -71,6 +71,7 @@ inline void Decode(T* obj, std::vector<Handle>* handles) {
// If returns true, this function also claims the memory range of the size // If returns true, this function also claims the memory range of the size
// specified in the struct header, starting from |data|. // specified in the struct header, starting from |data|.
// Note: |min_num_bytes| must be no less than sizeof(StructHeader).
bool ValidateStructHeader(const void* data, bool ValidateStructHeader(const void* data,
uint32_t min_num_bytes, uint32_t min_num_bytes,
uint32_t min_num_fields, uint32_t min_num_fields,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment