Fixes for perl 5.36 with multiplicity + memleak in $st->kv methods

I always keep messing up the aTHX_ and pTHX_ stuff because my system
perl isn't built with multiplicity, and I still haven't found a
satisfactory way of finding SV leaks. Valgrind can't track those :(
This commit is contained in:
Yorhel 2025-02-12 18:54:10 +01:00
parent 1f7e2de9a0
commit 867543267f
6 changed files with 40 additions and 32 deletions

View file

@ -240,12 +240,12 @@ static SV *fujson_parse(pTHX_ fujson_parse_ctx *ctx) {
if (ctx->end - ctx->buf < 4) return NULL;
if (memcmp(ctx->buf, "true", 4) != 0) return NULL;
ctx->buf += 4;
return newSV_true();
return &PL_sv_yes;
case 'f':
if (ctx->end - ctx->buf < 5) return NULL;
if (memcmp(ctx->buf, "false", 5) != 0) return NULL;
ctx->buf += 5;
return newSV_false();
return &PL_sv_no;
case 'n':
if (ctx->end - ctx->buf < 4) return NULL;
if (memcmp(ctx->buf, "null", 4) != 0) return NULL;