Skip to content

Commit

Permalink
only check for 0 address
Browse files Browse the repository at this point in the history
Signed-off-by: John Falkowski <[email protected]>
  • Loading branch information
johntfalk authored and Compute-Runtime-Automation committed Jul 25, 2022
1 parent c3d0d7a commit 17c5374
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shared/source/command_stream/linear_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ inline void *LinearStream::getSpace(size_t size) {
cmdContainer->closeAndAllocateNextCommandBuffer();
}
UNRECOVERABLE_IF(sizeUsed + size > maxAvailableSpace);
UNRECOVERABLE_IF(reinterpret_cast<int64_t>(buffer) <= 0);
UNRECOVERABLE_IF(reinterpret_cast<int64_t>(buffer) == 0);
auto memory = ptrOffset(buffer, sizeUsed);
sizeUsed += size;
return memory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ TEST_F(LinearStreamTest, GivenNullBufferWhenGettingSpaceThenAssert) {
}

TEST_F(LinearStreamTest, GivenBadBufferPtrWhenGettingSpaceThenAssert) {
int64_t ptr = -1;
int64_t ptr = 0;
linearStream.replaceBuffer(reinterpret_cast<void *>(ptr), 100);
EXPECT_THROW(linearStream.getSpace(1), std::exception);
}
Expand Down

0 comments on commit 17c5374

Please sign in to comment.