ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/XS.xs
(Generate patch)

Comparing CBOR-XS/XS.xs (file contents):
Revision 1.72 by root, Thu Oct 21 01:14:58 2021 UTC vs.
Revision 1.76 by root, Thu Sep 7 23:57:58 2023 UTC

985 } 985 }
986 else if (ecb_expect_true ((U8)(*dec->cur - MAJOR_TEXT) <= LENGTH_EXT8)) 986 else if (ecb_expect_true ((U8)(*dec->cur - MAJOR_TEXT) <= LENGTH_EXT8))
987 { 987 {
988 STRLEN len = decode_uint (dec); 988 STRLEN len = decode_uint (dec);
989 char *key = (char *)dec->cur; 989 char *key = (char *)dec->cur;
990 printf ("len %d\n", len);//D
991 990
992 WANT (len); 991 WANT (len);
993 dec->cur += len; 992 dec->cur += len;
994 993
995 if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8)) 994 if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8))
1224 UV idx = decode_uint (dec); 1223 UV idx = decode_uint (dec);
1225 1224
1226 if (!dec->shareable || idx >= (UV)(1 + AvFILLp (dec->shareable))) 1225 if (!dec->shareable || idx >= (UV)(1 + AvFILLp (dec->shareable)))
1227 ERR ("corrupted CBOR data (sharedref index out of bounds)"); 1226 ERR ("corrupted CBOR data (sharedref index out of bounds)");
1228 1227
1229 sv = SvREFCNT_inc_NN (AvARRAY (dec->shareable)[idx]); 1228 sv = newSVsv (AvARRAY (dec->shareable)[idx]);
1230 1229
1231 if (sv == &PL_sv_undef) 1230 if (sv == &PL_sv_undef)
1232 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");
1233 } 1232 }
1234 break; 1233 break;
1474 SvREFCNT_dec_NN (sv); 1473 SvREFCNT_dec_NN (sv);
1475 1474
1476 if (dec.err_sv) 1475 if (dec.err_sv)
1477 sv_2mortal (dec.err_sv); 1476 sv_2mortal (dec.err_sv);
1478 1477
1479 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);
1480 } 1479 }
1481 1480
1482 sv = sv_2mortal (sv); 1481 sv = sv_2mortal (sv);
1483 1482
1484 return sv; 1483 return sv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines