Skip to content

Commit c34b468

Browse files
author
Christian Convey
committed
[relay] Fix missing virtual destructor
Add missing virtual destructor for derived class `tvm::relay::transforms::ExistingGlobalSymbolCache`. Fixes a potential problem when deleting an instance using a pointer-to-base-class.
1 parent 70884e9 commit c34b468

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/relay/transforms/compiler_function_utils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class CallRewriter : public MixedModeMutator {
119119

120120
} // namespace
121121

122+
ExistingGlobalSymbolCache::~ExistingGlobalSymbolCache() {}
123+
122124
GlobalVar ExistingGlobalSymbolCache::GetGlobalSymbol(const Function& function) {
123125
Optional<String> opt_global_symbol = function->GetAttr<String>(tvm::attr::kGlobalSymbol);
124126
ICHECK(opt_global_symbol.defined())

src/relay/transforms/compiler_function_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class GlobalSymbolCache {
8080
*/
8181
class ExistingGlobalSymbolCache : public GlobalSymbolCache {
8282
public:
83+
virtual ~ExistingGlobalSymbolCache();
84+
8385
ExistingGlobalSymbolCache() = default;
8486

8587
GlobalVar GetGlobalSymbol(const Function& function) final;

0 commit comments

Comments
 (0)