diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-20 11:14:52 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-20 11:14:52 -0300 |
commit | 7d6a97e42bc3328b9c5ec1dabbd7e280e81c3efd (patch) | |
tree | 24c32dddd2b6df02d22bdcacc0636a18f37f7471 /ldump.c | |
parent | d70a0c91ad42275af1f6f1b6e37c604442b3f0d1 (diff) | |
download | lua-7d6a97e42bc3328b9c5ec1dabbd7e280e81c3efd.tar.gz lua-7d6a97e42bc3328b9c5ec1dabbd7e280e81c3efd.tar.bz2 lua-7d6a97e42bc3328b9c5ec1dabbd7e280e81c3efd.zip |
Dump doesn't need to reuse 'source'
All strings are being reused now, including 'source'.
Diffstat (limited to 'ldump.c')
-rw-r--r-- | ldump.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -126,7 +126,7 @@ static void dumpCode (DumpState *D, const Proto *f) { | |||
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | static void dumpFunction(DumpState *D, const Proto *f, TString *psource); | 129 | static void dumpFunction(DumpState *D, const Proto *f); |
130 | 130 | ||
131 | static void dumpConstants (DumpState *D, const Proto *f) { | 131 | static void dumpConstants (DumpState *D, const Proto *f) { |
132 | int i; | 132 | int i; |
@@ -159,7 +159,7 @@ static void dumpProtos (DumpState *D, const Proto *f) { | |||
159 | int n = f->sizep; | 159 | int n = f->sizep; |
160 | dumpInt(D, n); | 160 | dumpInt(D, n); |
161 | for (i = 0; i < n; i++) | 161 | for (i = 0; i < n; i++) |
162 | dumpFunction(D, f->p[i], f->source); | 162 | dumpFunction(D, f->p[i]); |
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
@@ -199,9 +199,9 @@ static void dumpDebug (DumpState *D, const Proto *f) { | |||
199 | } | 199 | } |
200 | 200 | ||
201 | 201 | ||
202 | static void dumpFunction (DumpState *D, const Proto *f, TString *psource) { | 202 | static void dumpFunction (DumpState *D, const Proto *f) { |
203 | if (D->strip || f->source == psource) | 203 | if (D->strip) |
204 | dumpString(D, NULL); /* no debug info or same source as its parent */ | 204 | dumpString(D, NULL); /* no debug info */ |
205 | else | 205 | else |
206 | dumpString(D, f->source); | 206 | dumpString(D, f->source); |
207 | dumpInt(D, f->linedefined); | 207 | dumpInt(D, f->linedefined); |
@@ -245,7 +245,7 @@ int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data, | |||
245 | D.nstr = 0; | 245 | D.nstr = 0; |
246 | dumpHeader(&D); | 246 | dumpHeader(&D); |
247 | dumpByte(&D, f->sizeupvalues); | 247 | dumpByte(&D, f->sizeupvalues); |
248 | dumpFunction(&D, f, NULL); | 248 | dumpFunction(&D, f); |
249 | return D.status; | 249 | return D.status; |
250 | } | 250 | } |
251 | 251 | ||