-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change jl_get_field_offset to test validity of and return the specifi…
…ed field offset
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -631,9 +631,9 @@ JL_DLLEXPORT long jl_SC_CLK_TCK(void) | |
|
||
JL_DLLEXPORT size_t jl_get_field_offset(jl_datatype_t *ty, int field) | ||
{ | ||
if (field > jl_datatype_nfields(ty)) | ||
if (field > jl_datatype_nfields(ty) || field < 1) | ||
jl_error("This type does not have that many fields"); | ||
return jl_field_offset(ty, field); | ||
return jl_field_offset(ty, field-1); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vtjnash
Author
Member
|
||
} | ||
|
||
JL_DLLEXPORT size_t jl_get_alignment(jl_datatype_t *ty) | ||
|
Is this (and
Base.field_offset
) used anywhere?