[erlang-patches] [PATCH 1/1] Documentation fix: ei_decode_ei_term() returns 1 if index is incremented

Anneli Cuss <>
Wed Sep 7 01:31:23 CEST 2011


Hi all,

Included is a documentation fix and very minor clean-up for
ei_decode_ei_term(). Links follow, then the synopsis.

    git fetch git://github.com/celtic/otp.git fix_erl_interface_docs

    https://github.com/celtic/otp/compare/fix_erl_interface_docs
    https://github.com/celtic/otp/compare/fix_erl_interface_docs.patch

The function terminates with:
        *index += s-s0;
        return 1;
    }

We note that there is no other case of `return 1` in the function
(i.e. the function never returns `1` without incrementing `*index`).
There are a few cases of returning `0`, and in none of these cases is
`*index` incremented. There are a few cases like this, however:

        case ERL_SMALL_TUPLE_EXT:
            term->arity = get8(s);
            break; /*return 0;*/

Thus `1` will be ultimately returned, and the tuple header passed.
This is good behaviour, but the documentation needs to reflect it. The
commented returns could probably do with being removed.

Thanks,

Anneli


More information about the erlang-patches mailing list