mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:27:35 +00:00
LibWasm: Specify which instruction opcode failed validation in error
This commit is contained in:
parent
805e6593b9
commit
8fdf4b43cd
1 changed files with 3 additions and 3 deletions
|
@ -318,9 +318,9 @@ ErrorOr<void, ValidationError> Validator::validate(Limits const& limits, size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
template<u32 opcode>
|
template<u32 opcode>
|
||||||
ErrorOr<void, ValidationError> Validator::validate_instruction(Instruction const&, Stack&, bool&)
|
ErrorOr<void, ValidationError> Validator::validate_instruction(Instruction const& instruction, Stack&, bool&)
|
||||||
{
|
{
|
||||||
return Errors::invalid("instruction opcode"sv);
|
return Errors::invalid(String::formatted("instruction opcode (0x{:x}) (missing validation!)", instruction.opcode().value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VALIDATE_INSTRUCTION(name) \
|
#define VALIDATE_INSTRUCTION(name) \
|
||||||
|
@ -2179,7 +2179,7 @@ ErrorOr<void, ValidationError> Validator::validate(Instruction const& instructio
|
||||||
#undef M
|
#undef M
|
||||||
default:
|
default:
|
||||||
is_constant = false;
|
is_constant = false;
|
||||||
return Errors::invalid("instruction opcode"sv);
|
return Errors::invalid(String::formatted("instruction opcode (0x{:x})", instruction.opcode().value()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue