aboutsummaryrefslogtreecommitdiff
path: root/ldump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-03-10 15:21:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-03-10 15:21:32 -0300
commitb5b1995f2925b2f9be4a48304ac97a38f8608648 (patch)
tree6935ced2337eb900029ccb119636185df5037fd8 /ldump.c
parentcb88c1cd5d22fe7c56f4f374ded7c16f7cf14bf3 (diff)
downloadlua-b5b1995f2925b2f9be4a48304ac97a38f8608648.tar.gz
lua-b5b1995f2925b2f9be4a48304ac97a38f8608648.tar.bz2
lua-b5b1995f2925b2f9be4a48304ac97a38f8608648.zip
Checks for type 'int' added to binary header
The structure 'AbsLineInfo' is hard-dumped into binary chunks, and it comprises two 'int' fields.
Diffstat (limited to 'ldump.c')
-rw-r--r--ldump.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ldump.c b/ldump.c
index 71d9a5b1..54f96674 100644
--- a/ldump.c
+++ b/ldump.c
@@ -253,16 +253,19 @@ static void dumpFunction (DumpState *D, const Proto *f) {
253} 253}
254 254
255 255
256#define dumpNumInfo(D, tvar, value) \
257 { tvar i = value; dumpByte(D, sizeof(tvar)); dumpVar(D, i); }
258
259
256static void dumpHeader (DumpState *D) { 260static void dumpHeader (DumpState *D) {
257 dumpLiteral(D, LUA_SIGNATURE); 261 dumpLiteral(D, LUA_SIGNATURE);
258 dumpByte(D, LUAC_VERSION); 262 dumpByte(D, LUAC_VERSION);
259 dumpByte(D, LUAC_FORMAT); 263 dumpByte(D, LUAC_FORMAT);
260 dumpLiteral(D, LUAC_DATA); 264 dumpLiteral(D, LUAC_DATA);
261 dumpByte(D, sizeof(Instruction)); 265 dumpNumInfo(D, int, LUAC_INT);
262 dumpByte(D, sizeof(lua_Integer)); 266 dumpNumInfo(D, Instruction, LUAC_INST);
263 dumpByte(D, sizeof(lua_Number)); 267 dumpNumInfo(D, lua_Integer, LUAC_INT);
264 dumpInteger(D, LUAC_INT); 268 dumpNumInfo(D, lua_Number, LUAC_NUM);
265 dumpNumber(D, LUAC_NUM);
266} 269}
267 270
268 271