… | |
… | |
1223 | UV idx = decode_uint (dec); |
1223 | UV idx = decode_uint (dec); |
1224 | |
1224 | |
1225 | if (!dec->shareable || idx >= (UV)(1 + AvFILLp (dec->shareable))) |
1225 | if (!dec->shareable || idx >= (UV)(1 + AvFILLp (dec->shareable))) |
1226 | ERR ("corrupted CBOR data (sharedref index out of bounds)"); |
1226 | ERR ("corrupted CBOR data (sharedref index out of bounds)"); |
1227 | |
1227 | |
1228 | sv = SvREFCNT_inc_NN (AvARRAY (dec->shareable)[idx]); |
1228 | sv = newSVsv (AvARRAY (dec->shareable)[idx]); |
1229 | |
1229 | |
1230 | if (sv == &PL_sv_undef) |
1230 | if (sv == &PL_sv_undef) |
1231 | ERR ("cyclic CBOR data structure found, but allow_cycles is not enabled"); |
1231 | ERR ("cyclic CBOR data structure found, but allow_cycles is not enabled"); |
1232 | } |
1232 | } |
1233 | break; |
1233 | break; |
… | |
… | |
1473 | SvREFCNT_dec_NN (sv); |
1473 | SvREFCNT_dec_NN (sv); |
1474 | |
1474 | |
1475 | if (dec.err_sv) |
1475 | if (dec.err_sv) |
1476 | sv_2mortal (dec.err_sv); |
1476 | sv_2mortal (dec.err_sv); |
1477 | |
1477 | |
1478 | croak ("%s, at offset %d (octet 0x%02x)", dec.err, dec.cur - (U8 *)data, (int)(uint8_t)*dec.cur); |
1478 | croak ("%s, at offset %ld (octet 0x%02x)", dec.err, (long)(dec.cur - (U8 *)data), (int)(uint8_t)*dec.cur); |
1479 | } |
1479 | } |
1480 | |
1480 | |
1481 | sv = sv_2mortal (sv); |
1481 | sv = sv_2mortal (sv); |
1482 | |
1482 | |
1483 | return sv; |
1483 | return sv; |