Skip to content

Commit

Permalink
Emit vtables once
Browse files Browse the repository at this point in the history
This fixes -Wweak-vtable warnings
  • Loading branch information
chfast committed Sep 4, 2020
1 parent e4806a1 commit 5d38cab
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/fizzy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target_sources(
fizzy PRIVATE
bytes.hpp
constexpr_vector.hpp
exceptions.cpp
exceptions.hpp
execute.cpp
execute.hpp
instructions.cpp
Expand Down
12 changes: 12 additions & 0 deletions lib/fizzy/exceptions.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Fizzy: A fast WebAssembly interpreter
// Copyright 2020 The Fizzy Authors.
// SPDX-License-Identifier: Apache-2.0

#include "exceptions.hpp"

namespace fizzy
{
parser_error::~parser_error() noexcept = default;
validation_error::~validation_error() noexcept = default;
instantiate_error::~instantiate_error() noexcept = default;
} // namespace fizzy
6 changes: 6 additions & 0 deletions lib/fizzy/exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ namespace fizzy
struct parser_error : public std::runtime_error
{
using runtime_error::runtime_error;

~parser_error() noexcept override;
};

struct validation_error : public std::runtime_error
{
using runtime_error::runtime_error;

~validation_error() noexcept override;
};

struct instantiate_error : public std::runtime_error
{
using runtime_error::runtime_error;

~instantiate_error() noexcept override;
};

} // namespace fizzy
3 changes: 3 additions & 0 deletions test/utils/wasm_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
// Copyright 2020 The Fizzy Authors.
// SPDX-License-Identifier: Apache-2.0

#include "wasm_engine.hpp"
#include <stdexcept>
#include <string>

namespace fizzy::test
{
WasmEngine::~WasmEngine() noexcept = default;

void validate_function_signature(std::string_view signature)
{
if (signature.find_first_of(":") == std::string::npos)
Expand Down
2 changes: 1 addition & 1 deletion test/utils/wasm_engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class WasmEngine
std::optional<uint64_t> value;
};

virtual ~WasmEngine() noexcept = default;
virtual ~WasmEngine() noexcept;

/// Parses input wasm binary. The created module is discarded.
/// Returns false on parsing error.
Expand Down

0 comments on commit 5d38cab

Please sign in to comment.