Return static pointer address for zero-length GetMappedRange
Bug: chromium:1430985 Change-Id: I0d13fce695bd999dd9e6a8127b91cea15276df22 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128960 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
648db6cfb2
commit
2dc9fe842d
|
@ -435,7 +435,8 @@ void* BufferBase::GetMappedRange(size_t offset, size_t size, bool writable) {
|
|||
return static_cast<uint8_t*>(mStagingBuffer->GetMappedPointer()) + offset;
|
||||
}
|
||||
if (mSize == 0) {
|
||||
return reinterpret_cast<uint8_t*>(intptr_t(0xCAFED00D));
|
||||
static uint32_t zeroRange = 0xCAFED00D;
|
||||
return &zeroRange;
|
||||
}
|
||||
uint8_t* start = static_cast<uint8_t*>(GetMappedPointer());
|
||||
return start == nullptr ? nullptr : start + offset;
|
||||
|
|
Loading…
Reference in New Issue