Index: test/unittests/wasm/decoder-unittest.cc |
diff --git a/test/unittests/wasm/decoder-unittest.cc b/test/unittests/wasm/decoder-unittest.cc |
index d1580c3a7d9d99dfb08dc18eb88dece23c334468..fdb353714e5c320bf1d7c36081d2989a0dccdc15 100644 |
--- a/test/unittests/wasm/decoder-unittest.cc |
+++ b/test/unittests/wasm/decoder-unittest.cc |
@@ -671,6 +671,13 @@ TEST_F(DecoderTest, ReadI64v_extra_bits_positive) { |
EXPECT_FALSE(decoder.ok()); |
} |
+TEST_F(DecoderTest, FailOnNullData) { |
+ decoder.Reset(nullptr, 0); |
+ decoder.checkAvailable(1); |
+ EXPECT_FALSE(decoder.ok()); |
+ EXPECT_FALSE(decoder.toResult(nullptr).ok()); |
+} |
+ |
} // namespace wasm |
} // namespace internal |
} // namespace v8 |