mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add documentation.
This commit is contained in:
parent
bf57500e25
commit
a9c16b8c39
@ -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
|
||||
------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user