Skip to content

Commit

Permalink
wasm: remove unused parameter from getUserSection(). (envoyproxy#58)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
  • Loading branch information
PiotrSikora committed Apr 22, 2019
1 parent e190fb6 commit ea56a23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 2 additions & 3 deletions source/extensions/common/wasm/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,8 @@ class WasmVm : public Logger::Loggable<Logger::Id::wasm> {
// Make a new intrinsic module (e.g. for Emscripten support).
virtual void makeModule(absl::string_view name) PURE;

// Get the contents of the user section with the given name or "" if it does not exist and
// optionally a presence indicator.
virtual absl::string_view getUserSection(absl::string_view name, bool* present = nullptr) PURE;
// Get the contents of the user section with the given name or "" if it does not exist.
virtual absl::string_view getUserSection(absl::string_view name) PURE;

// Get typed function exported by the WASM module.
virtual void getFunction(absl::string_view functionName, WasmCall0Void* f) PURE;
Expand Down
10 changes: 2 additions & 8 deletions source/extensions/common/wasm/wavm/wavm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ struct Wavm : public WasmVm {
bool getMemoryOffset(void* host_pointer, uint32_t* vm_pointer) override;
bool setMemory(uint32_t pointer, uint32_t size, void* data) override;
void makeModule(absl::string_view name) override;
absl::string_view getUserSection(absl::string_view name, bool* present) override;
absl::string_view getUserSection(absl::string_view name) override;

void getInstantiatedGlobals();

Expand Down Expand Up @@ -444,18 +444,12 @@ bool Wavm::setMemory(uint32_t pointer, uint32_t size, void* data) {
}
}

absl::string_view Wavm::getUserSection(absl::string_view name, bool* present) {
absl::string_view Wavm::getUserSection(absl::string_view name) {
for (auto& section : irModule_.userSections) {
if (section.name == name) {
if (present) {
*present = true;
}
return {reinterpret_cast<char*>(section.data.data()), section.data.size()};
}
}
if (present) {
*present = false;
}
return {};
}

Expand Down

0 comments on commit ea56a23

Please sign in to comment.