Skip to content

Commit

Permalink
Remove early exist from mode memory slicing.
Browse files Browse the repository at this point in the history
Corruption of the original memory's data type can occur when `this` is
returned.
  • Loading branch information
kris-rowe committed Dec 8, 2023
1 parent 4f0e876 commit 8a7f0be
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/occa/internal/core/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ namespace occa {

modeMemory_t* modeMemory_t::slice(const dim_t offset_,
const udim_t bytes) {

//quick return if we're not really slicing
if ((offset_ == 0) && (bytes == size)) return this;

OCCA_ERROR("ModeMemory not initialized or has been freed",
modeBuffer != NULL);

Expand Down

0 comments on commit 8a7f0be

Please sign in to comment.