Files
ladybird/Tests/LibWeb/Text/input/Wasm/WebAsssembly-invalid-module-crashes.html
Luke Wilde 1ff15a3b44 LibWasm: Add missing tag section validation
This also removes the duplicate tag type.
2026-01-08 18:49:24 +01:00

23 lines
713 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(async (done) => {
const testCases = [
"AGFzbQEAAAAJEhAAHwAABQ==", // Structured else has argument type that isn't StructuredInstructionArgs
"AGFzbQEAAAANAwEABA==", // Type index in tag section is out of bounds
];
for (const testCase of testCases) {
try {
await WebAssembly.instantiate(Uint8Array.fromBase64(testCase));
println("FAIL! Test case unexpectedly instantiated.");
} catch (e) {
println(e.toString());
}
}
println("PASS! (Didn't crash)");
done();
});
</script>