Skip to content

Commit

Permalink
make fieldtype computation stable/pure
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored and DilumAluthge committed Mar 22, 2022
1 parent 95da0d8 commit 99bdd00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,9 +1788,9 @@ JL_DLLEXPORT int jl_field_isdefined(jl_value_t *v, size_t i) JL_NOTSAFEPOINT
return fval != NULL ? 1 : 0;
}

JL_DLLEXPORT size_t jl_get_field_offset(jl_datatype_t *ty, int field) JL_NOTSAFEPOINT
JL_DLLEXPORT size_t jl_get_field_offset(jl_datatype_t *ty, int field)
{
if (ty->layout == NULL || field > jl_datatype_nfields(ty) || field < 1)
if (!jl_struct_try_layout(ty) || field > jl_datatype_nfields(ty) || field < 1)
jl_bounds_error_int((jl_value_t*)ty, field);
return jl_field_offset(ty, field - 1);
}
Expand Down
1 change: 0 additions & 1 deletion src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@
XX(jl_get_excstack) \
XX(jl_get_fenv_consts) \
XX(jl_get_field) \
XX(jl_get_field_offset) \
XX(jl_get_global) \
XX(jl_get_image_file) \
XX(jl_get_JIT) \
Expand Down

0 comments on commit 99bdd00

Please sign in to comment.