mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWasm: Validate indirect calls at runtime
This is required by the spec, and also unbreaks all of the call-indirect wpt tests.
This commit is contained in:
parent
39b637a446
commit
d79d5b70a5
Notes:
github-actions[bot]
2025-05-22 06:37:18 +00:00
Author: https://github.com/alimpfard
Commit: d79d5b70a5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4833
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 18 additions and 3 deletions
|
@ -47,6 +47,11 @@ struct BytecodeInterpreter : public Interpreter {
|
|||
BytecodeInterpreter& m_interpreter;
|
||||
};
|
||||
|
||||
enum class CallAddressSource {
|
||||
DirectCall,
|
||||
IndirectCall,
|
||||
};
|
||||
|
||||
protected:
|
||||
void interpret_instruction(Configuration&, InstructionPointer&, Instruction const&);
|
||||
void branch_to_label(Configuration&, LabelIndex);
|
||||
|
@ -71,7 +76,7 @@ protected:
|
|||
template<typename M, template<typename> typename SetSign, typename VectorType = Native128ByteVectorOf<M, SetSign>>
|
||||
VectorType pop_vector(Configuration&);
|
||||
void store_to_memory(Configuration&, Instruction::MemoryArgument const&, ReadonlyBytes data, u32 base);
|
||||
void call_address(Configuration&, FunctionAddress);
|
||||
void call_address(Configuration&, FunctionAddress, CallAddressSource = CallAddressSource::DirectCall);
|
||||
|
||||
template<typename PopTypeLHS, typename PushType, typename Operator, typename PopTypeRHS = PopTypeLHS, typename... Args>
|
||||
void binary_numeric_operation(Configuration&, Args&&...);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue