Skip to content

Commit

Permalink
Erase decl_buffer when it goes out of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 committed Aug 30, 2022
1 parent 6807883 commit 071b81d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/printer/tvmscript_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class BufferUsageFinder : public StmtExprVisitor {
void VisitStmt_(const DeclBufferNode* op) final {
buffers_declared_.insert(op->buffer.get());
StmtExprVisitor::VisitStmt_(op);
buffers_declared_.erase(op->buffer.get());
}

private:
Expand Down Expand Up @@ -1069,7 +1070,7 @@ namespace {

bool IsAllocateDeclBufferPattern(const AllocateNode* allocate) {
const Var& buffer_var = allocate->buffer_var;
const DeclBufferNode* decl_buffer = allocat->body.as<DeclBufferNode>();
const DeclBufferNode* decl_buffer = allocate->body.as<DeclBufferNode>();
if (!decl_buffer) {
return false;
}
Expand Down

0 comments on commit 071b81d

Please sign in to comment.