3.27 Arbitrary Jumps
Arbitrary jumps are possible within Solidity
. Solidity
supports many different types, one of which is a function type. These function type variables are not frequently encountered, but if they are, they can are mainly found within assembly code in making arbitrary manipulations to variables of these types. In that case, they could be used to change the control flow to switch to an arbitrary location in the code. This is something to be paid attention to and from a development perspective something to be avoided.
Assembly in general is very tricky to use and it bypasses many security aspects of Solidity
such as type safety, so it's best to avoid the use of assembly if possible and definitely to avoid the use of function type variables and making arbitrary changes to it. This is because that could result in changes to control flow that is unexpected by the developers or the smart contract auditors.
Last updated