Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1829)

Unified Diff: test/unittests/wasm/decoder-unittest.cc

Issue 2410913002: [wasm] Fix decoder for null data (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/wasm/decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698