-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The current specification does not state if instructions may panic. Off the top of my head, here are instructions for which this should be clarified:
panic- self-explanatory.syscall- I'm not sure any current soil implementation uses panicking syscalls, but they could be useful for error handling. Also, invalid syscall numbers may cause a panic.- memory instructions - Out-of-bounds accesses are specified to cause panics. However, it might be helpful to annotate the memory instructions as panicking.
- Division (
divandfdiv) - Divide by zero causes a panic in all implementations that I am aware of, but the specification does not state this. tryend,ret- If these instruction appear without atrystartorcallrespectively before, they should likely panic.jump,cjump,call- jumps to illegal addresses should panic.
There is also the question of handling instructions that specify invalid registers. However, since the set of valid registers is well-defined, bytecode containing invalid registers should be considered as malformed or invalid from the start. We might specify that a VM should refuse to execute such code at all or immediately end execution without the possibility of error recovery.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels