diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-10 15:21:32 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-10 15:21:32 -0300 |
commit | b5b1995f2925b2f9be4a48304ac97a38f8608648 (patch) | |
tree | 6935ced2337eb900029ccb119636185df5037fd8 /ldump.c | |
parent | cb88c1cd5d22fe7c56f4f374ded7c16f7cf14bf3 (diff) | |
download | lua-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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 | |||
256 | static void dumpHeader (DumpState *D) { | 260 | static 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 | ||