Skip to content

Commit

Permalink
Add an assert for an implicit assumption on struct layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jul 15, 2015
1 parent 7541908 commit a96afe2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ DLLEXPORT void jl_uv_writecb(uv_write_t *req, int status)
static void jl_write(uv_stream_t *stream, const char *str, size_t n)
{
assert(stream);
_Static_assert(offsetof(uv_stream_t,type) == offsetof(ios_t,bm) &&
sizeof(((uv_stream_t*)0)->type) == sizeof(((ios_t*)0)->bm),
"UV and ios layout mismatch");

uv_file fd = 0;

Expand Down

0 comments on commit a96afe2

Please sign in to comment.