Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix compiler warning on gcc 5.1.0


Add latest Erlang VMs to the test matrix


Fix dialyzer type specs


Account for char possibly being unsigned
This sounds rather insane to me but I've managed to show that `(char)
-1` is converted to 255 on some platforms. This was reproduced on
ppc64el via Qemu on OS X. A simple program that does `fprintf(stderr,
"%d\r\n", (char) -1);` prints 255 to the console. Rather than rely on
the signedness of a char I've just updated things to use an unsigned
char (which hopefully is never signed) and replaced -1 with 255 for the
sentinel value when converting hex values.

Thanks to Balint Reczey (@rbalint) for the report.

Fixes #74


Fix memory leak when encoding bare bignums
This fixes a leak when encoding a bare bignum. Technically it would be
possible to hit this memory leak randomly with bignums in objects but
the chances are highly unlikely.

Thanks to @miriampena for the issue.

Fixes #69


Remove unnecessary inclusion of proper.hrl


Persist the `val` register across yield
The `val` variable is a register value that we need to be able to return
at any time from `decode_iter`. If it happened that a yield was
triggered while processing trailing whitespace the lack of persistance
caused decode to return a term intialized from a random integer value.
Obviously the Erlang VM did not enjoy this.

Thanks to @michalpalka for the report.

Fixes #66


Improved Elixir compatibility
This implements the `use_nil` option as discussed on issue #64. Passing
the atom `use_nil` as an option to both encode and decode will replace
the atom `null` with `nil` when decoding and encode `nil` as `null` when
encoding values.

Fixes #64
Fixes #68


Avoid uint64 for 32bit compatibility
Rather than worry about truncation casting from a possibly 64bit value
down to a possibly 32bit size_t we just limit the total bytes per
invocation to 4G using an unsigned integer.

Thanks to @seriyps for the report.

Fixes #61


Disable strict aliasing
This is motivated by issue #60 to see if we can get away with `-O3`
while still handling the cast of a `Decoder**` to `void**`.

Fixes #60
Something went wrong with that request. Please try again.