Skip to content

Commit

Permalink
fix bug: SIGBUS encountered on some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
i-evi committed Dec 7, 2021
1 parent 0052965 commit 93a2625
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cc_tsrmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void cc_tsrmgr_unpack(struct list *tls)
struct list *container;
cc_uint8 *dptr, *rptr;
cc_ssize j, off, len;
rlen_t rlen;
cc_usize i;
if (!cc_tsrmgr_status())
cc_tsrmgr_init();
Expand All @@ -287,7 +288,8 @@ void cc_tsrmgr_unpack(struct list *tls)
off = strlen(name) + 1;
for (j = 0; j < CC_TENSOR_ITEMS; ++j) {
/* Ref: util_list.h */
len = *(rlen_t*)(rptr + off);
memcpy(&rlen, rptr + off, sizeof(rlen));
len = rlen;
dptr = rptr + off + sizeof(rlen_t);
cc_assert_ptr(
list_set_data(container, j, dptr, len));
Expand Down

0 comments on commit 93a2625

Please sign in to comment.