Fix Wasm dummy function

This commit is contained in:
Brian Carroll 2022-11-16 20:34:38 +00:00
parent e57ca0aa12
commit 24cef94fb5
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0

View file

@ -682,8 +682,7 @@ macro_rules! round_up_to_alignment {
/// Bytes for a dummy function with just a single `unreachable` instruction.
/// Used in dead code elimination to replace unused functions.
const DUMMY_FUNCTION: [u8; 4] = [
3, // inner byte length
const DUMMY_FUNCTION: [u8; 3] = [
0, // number of local variable declarations
OpCode::UNREACHABLE as u8, // panic if we were wrong to eliminate!
OpCode::END as u8, // end of function (required for validation)