-
Notifications
You must be signed in to change notification settings - Fork 699
Description
The design and spec interpreter use an explicit signature table to check call_indirect signatures. This is effectively a nominal type system for function pointers: you can have two signature table entries with the same parameters and return type, and they are distinct types as far as call_indirect is concerned.
This rules out calling a pointer to a function in a different module, since you can't refer to the target module's signature for the function, and in general doesn't work with dynamic linking.
I think that call_indirect signature checks should be defined structurally: that if a call_indirect expects the same parameter types and return type as the function identified by its dynamic index, the signature check should succeed.
The signature table makes sense from an encoding and implementation perspective, but I don't think it's necessary to define WebAssembly semantics. So I think the design shouldn't mention a signature table, and should be explicit that the signature check is structural.