diff options
author | Andrei Maiboroda <andrei@ethereum.org> | 2020-09-14 18:47:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-14 09:47:58 -0700 |
commit | 21350996d5bbcd9cafbaa3a5687e6fb503da060c (patch) | |
tree | 20279c0b3ebc03a762b9a66f66f7ba0629de0f31 /src | |
parent | 58e0e3812d69efb3b5f55613b0f73d5f864e6b51 (diff) | |
download | wabt-21350996d5bbcd9cafbaa3a5687e6fb503da060c.tar.gz wabt-21350996d5bbcd9cafbaa3a5687e6fb503da060c.tar.bz2 wabt-21350996d5bbcd9cafbaa3a5687e6fb503da060c.zip |
Fix RefPtr::empty() (#1544)
Diffstat (limited to 'src')
-rw-r--r-- | src/interp/interp-inl.h | 2 | ||||
-rw-r--r-- | src/test-interp.cc | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/interp/interp-inl.h b/src/interp/interp-inl.h index fbec1014..9cab1fa9 100644 --- a/src/interp/interp-inl.h +++ b/src/interp/interp-inl.h @@ -297,7 +297,7 @@ RefPtr<U> RefPtr<T>::As() { template <typename T> bool RefPtr<T>::empty() const { - return obj_ != nullptr; + return obj_ == nullptr; } template <typename T> diff --git a/src/test-interp.cc b/src/test-interp.cc index 737f440c..d911aee2 100644 --- a/src/test-interp.cc +++ b/src/test-interp.cc @@ -61,7 +61,10 @@ class InterpTest : public ::testing::Test { TEST_F(InterpTest, Empty) { + ASSERT_TRUE(mod_.empty()); ReadModule({0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00}); + Instantiate(); + ASSERT_FALSE(mod_.empty()); } TEST_F(InterpTest, MVP) { |