sockets.recv optimizations; stdlib now supports taint mode
This commit is contained in:
parent
485c371942
commit
0f37d0e1f2
14 changed files with 112 additions and 74 deletions
|
|
@ -3402,3 +3402,25 @@ The interaction between threads and exceptions is simple: A *handled* exception
|
|||
in one thread cannot affect any other thread. However, an *unhandled*
|
||||
exception in one thread terminates the whole *process*!
|
||||
|
||||
Taint mode
|
||||
==========
|
||||
|
||||
The Nimrod compiler and standard library support a `taint mode`:idx:.
|
||||
Input strings are declared with the `TaintedString`:idx: string type declared
|
||||
in the ``system`` module.
|
||||
|
||||
If the taint mode is turned on (via the ``--taintMode:on`` command line
|
||||
option) it is a distinct string type which helps to detect input
|
||||
validation errors:
|
||||
|
||||
.. code-block:: nimrod
|
||||
echo "your name: "
|
||||
var name: TaintedString = stdin.readline
|
||||
# it is safe here to output the name without any input validation, so
|
||||
# we simply convert `name` to string to make the compiler happy:
|
||||
echo "hi, ", name.string
|
||||
|
||||
If the taint mode is turned off, ``TaintedString`` is simply an alias for
|
||||
``string``.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue