From eabf425c76e0089eb88e102e2a44d8c8a37bc213 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 13 Nov 2023 13:11:09 -0300 Subject: Correct anchoring and GC barriers in 'loadString' Call to 'luaH_setint' could call the GC with the string unanchored. Moreover, previously saved strings were being assigned to the prototype without a barrier. --- ldump.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ldump.c') diff --git a/ldump.c b/ldump.c index 090d6aab..9c315cdd 100644 --- a/ldump.c +++ b/ldump.c @@ -144,7 +144,7 @@ static void dumpCode (DumpState *D, const Proto *f) { } -static void dumpFunction(DumpState *D, const Proto *f); +static void dumpFunction (DumpState *D, const Proto *f); static void dumpConstants (DumpState *D, const Proto *f) { int i; @@ -218,10 +218,6 @@ static void dumpDebug (DumpState *D, const Proto *f) { static void dumpFunction (DumpState *D, const Proto *f) { - if (D->strip) - dumpString(D, NULL); /* no debug info */ - else - dumpString(D, f->source); dumpInt(D, f->linedefined); dumpInt(D, f->lastlinedefined); dumpByte(D, f->numparams); @@ -231,6 +227,7 @@ static void dumpFunction (DumpState *D, const Proto *f) { dumpConstants(D, f); dumpUpvalues(D, f); dumpProtos(D, f); + dumpString(D, D->strip ? NULL : f->source); dumpDebug(D, f); } -- cgit v1.2.3-55-g6feb