Skip to content

Commit

Permalink
Suppress clang-tidy false memory leak warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 authored and axic committed Feb 7, 2020
1 parent 387f878 commit aba1d78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ Instance instantiate(Module module, std::vector<ImportedFunction> imported_funct
std::memcpy(memory->data() + offset, data.init.data(), data.init.size());
}

// FIXME: clang-tidy warns about potential memory leak for moving memory (which is in fact
// safe), but also erroneously points this warning to std::move(table)
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
Instance instance = {std::move(module), std::move(memory), memory_max, std::move(table),
std::move(globals), std::move(imported_functions), std::move(imported_function_types),
std::move(imported_globals)};
Expand Down

0 comments on commit aba1d78

Please sign in to comment.