Skip to content

Commit

Permalink
fix JuliaLang#28317, precompile saving wrong union selector byte
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 29, 2018
1 parent be653a4 commit 2a275f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ static void jl_serialize_value_(jl_serializer_state *s, jl_value_t *v, int as_li
if (!jl_field_isptr(t, i)) {
uint8_t sel = 0;
if (jl_is_uniontype(jl_field_type(t, i))) {
sel = ((uint8_t*)v)[offs + fsz - 1];
sel = ((uint8_t*)v)[offs + fsz - 1] + 1;
}
write_int8(s->s, sel);
}
Expand Down
2 changes: 2 additions & 0 deletions test/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ try
@test (Foo.abigfloat_x::BigFloat + 21) == big"64.21"
@test Foo.abigint_f()::BigInt == big"123"
@test Foo.abigint_x::BigInt + 1 == big"125"

@test Foo.x28297.result === missing
end

cachedir = joinpath(dir, "compiled", "v$(VERSION.major).$(VERSION.minor)")
Expand Down

0 comments on commit 2a275f7

Please sign in to comment.