aboutsummaryrefslogtreecommitdiffstats
path: root/docs/control-structures.rst
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-09 17:47:54 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-11-12 00:48:03 +0800
commit1af3c4f754be05c82a0aee4d309a3e681387eaed (patch)
tree9bbb06e8c45ede46c1631960e2be70856fc129d4 /docs/control-structures.rst
parent98dcd883e4ee1b3d62a1b9e7d4e5d4e038ea0434 (diff)
downloaddexon-solidity-1af3c4f754be05c82a0aee4d309a3e681387eaed.tar.gz
dexon-solidity-1af3c4f754be05c82a0aee4d309a3e681387eaed.tar.zst
dexon-solidity-1af3c4f754be05c82a0aee4d309a3e681387eaed.zip
docs: document the new overflow exception during conversion into enum
Diffstat (limited to 'docs/control-structures.rst')
-rw-r--r--docs/control-structures.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/control-structures.rst b/docs/control-structures.rst
index 51f43015..bbb90e6a 100644
--- a/docs/control-structures.rst
+++ b/docs/control-structures.rst
@@ -329,9 +329,10 @@ Currently, there are situations, where exceptions happen automatically in Solidi
3. If you call a function via a message call but it does not finish properly (i.e. it runs out of gas, has no matching function, or throws an exception itself), except when a low level operation ``call``, ``send``, ``delegatecall`` or ``callcode`` is used. The low level operations never throw exceptions but indicate failures by returning ``false``.
4. If you create a contract using the ``new`` keyword but the contract creation does not finish properly (see above for the definition of "not finish properly").
5. If you divide or modulo by zero (e.g. ``5 / 0`` or ``23 % 0``).
-6. If you perform an external function call targeting a contract that contains no code.
-7. If your contract receives Ether via a public function without ``payable`` modifier (including the constructor and the fallback function).
-8. If your contract receives Ether via a public accessor function.
+6. If you convert a value too big or negative into an enum type.
+7. If you perform an external function call targeting a contract that contains no code.
+8. If your contract receives Ether via a public function without ``payable`` modifier (including the constructor and the fallback function).
+9. If your contract receives Ether via a public accessor function.
Internally, Solidity performs an "invalid jump" when an exception is thrown and thus causes the EVM to revert all changes made to the state. The reason for this is that there is no safe way to continue execution, because an expected effect did not occur. Because we want to retain the atomicity of transactions, the safest thing to do is to revert all changes and make the whole transaction (or at least call) without effect.