diff options
author | chriseth <chris@ethereum.org> | 2018-04-16 18:46:48 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-04-16 18:47:38 +0800 |
commit | a9c16b8c3976dbd2c386586cdf143150a4266ac0 (patch) | |
tree | cbd7dbe0fcc6d97b66668ab50e460fdc86eca4e1 /docs | |
parent | bf57500e250c0ebaed4b608626245dde4b423ba1 (diff) | |
download | dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.tar dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.tar.gz dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.tar.bz2 dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.tar.lz dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.tar.xz dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.tar.zst dexon-solidity-a9c16b8c3976dbd2c386586cdf143150a4266ac0.zip |
Add documentation.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/assembly.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/assembly.rst b/docs/assembly.rst index 705cd1b8..978e71e3 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -405,6 +405,16 @@ changes during the call, and thus references to local variables will be wrong. } } +.. note:: + If you access variables of a type that spans less than 256 bits + (for example ``uint64``, ``address``, ``bytes16`` or ``byte``), + you cannot make any assumptions about bits not part of the + encoding of the type. Especially, do not assume them to be zero. + To be safe, always clear the data properly before you use it + in a context where this is important: + ``uint32 x = f(); assembly { x := and(x, 0xffffffff) /* now use x */ }`` + To clean signed types, you can use the ``signextend`` opcode. + Labels ------ |