diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-11 15:05:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-11 15:05:46 -0300 |
commit | e9763842134ac807262e3b86d5f40d25a8d69f1b (patch) | |
tree | 30ae76f6e935fc09dbce8b247b7c31182a76922d /ldump.c | |
parent | 68f4ccdd00edac2a1b02878f0ef6fa32e8893857 (diff) | |
download | lua-e9763842134ac807262e3b86d5f40d25a8d69f1b.tar.gz lua-e9763842134ac807262e3b86d5f40d25a8d69f1b.tar.bz2 lua-e9763842134ac807262e3b86d5f40d25a8d69f1b.zip |
keep chunk's headers compatible at least up to LUAC_VERSION (to be
able to detect correctly version mismatches)
Diffstat (limited to 'ldump.c')
-rw-r--r-- | ldump.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldump.c,v 2.24 2014/03/01 15:18:44 roberto Exp roberto $ | 2 | ** $Id: ldump.c,v 2.25 2014/03/10 17:56:32 roberto Exp roberto $ |
3 | ** save precompiled Lua chunks | 3 | ** save precompiled Lua chunks |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -160,11 +160,13 @@ static void DumpFunction (const Proto *f, DumpState *D) { | |||
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | #define DumpLiteral(s,D) DumpBlock(s, sizeof(s) - sizeof(char), D) | ||
164 | |||
163 | static void DumpHeader (DumpState *D) { | 165 | static void DumpHeader (DumpState *D) { |
164 | DumpBlock(LUA_SIGNATURE, sizeof(LUA_SIGNATURE), D); | 166 | DumpLiteral(LUA_SIGNATURE, D); |
165 | DumpBlock(LUAC_DATA, sizeof(LUAC_DATA), D); | ||
166 | DumpByte(LUAC_VERSION, D); | 167 | DumpByte(LUAC_VERSION, D); |
167 | DumpByte(LUAC_FORMAT, D); | 168 | DumpByte(LUAC_FORMAT, D); |
169 | DumpLiteral(LUAC_DATA, D); | ||
168 | DumpByte(sizeof(int), D); | 170 | DumpByte(sizeof(int), D); |
169 | DumpByte(sizeof(size_t), D); | 171 | DumpByte(sizeof(size_t), D); |
170 | DumpByte(sizeof(Instruction), D); | 172 | DumpByte(sizeof(Instruction), D); |