Skip to content

Commit

Permalink
fix decode array
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Jan 24, 2024
1 parent ca942fb commit 7c433dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frameworks/3rd/pbc/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,17 @@ pbc_decode(struct pbc_env * env, const char * type_name , struct pbc_slice * sli

int i;
for (i=0;i<ctx->number;i++) {
int id = ctx->a[i].wire_id >> 3;
int wire_id = ctx->a[i].wire_id;
int id = wire_id >> 3;
int wire = wire_id & 7;
struct _field * f = (struct _field *)_pbcM_ip_query(msg->id , id);
if (f==NULL) {
int err = call_unknown(pd,ud,id,&ctx->a[i],start);
if (err) {
_pbcC_close(_ctx);
return -i-1;
}
} else if (f->label == LABEL_PACKED || (f->label == LABEL_REPEATED && is_numeric_array(f))) {
} else if (f->label == LABEL_PACKED || (wire == WT_LEND && f->label == LABEL_REPEATED && is_numeric_array(f))) {
struct atom * a = &ctx->a[i];
int n = call_array(pd, ud, f , start + a->v.s.start , a->v.s.end - a->v.s.start);
if (n < 0) {
Expand Down

0 comments on commit 7c433dd

Please sign in to comment.