diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-27 13:56:20 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-27 13:56:20 -0300 |
| commit | 054179c2ffb108eb0c6535bed6288f70217c96ab (patch) | |
| tree | ec291d2ac795f75e29fc37df07d33689bb399be6 /ldump.c | |
| parent | 986c11daa66b6f0004f878bcbb9deaf5edbe15ee (diff) | |
| download | lua-054179c2ffb108eb0c6535bed6288f70217c96ab.tar.gz lua-054179c2ffb108eb0c6535bed6288f70217c96ab.tar.bz2 lua-054179c2ffb108eb0c6535bed6288f70217c96ab.zip | |
more explicit handling of headers for binary chunks
Diffstat (limited to 'ldump.c')
| -rw-r--r-- | ldump.c | 16 |
1 files changed, 12 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldump.c,v 2.18 2013/04/12 19:07:09 roberto Exp roberto $ | 2 | ** $Id: ldump.c,v 2.19 2013/04/26 18:48:35 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 | */ |
| @@ -159,9 +159,17 @@ static void DumpFunction(const Proto* f, DumpState* D) | |||
| 159 | 159 | ||
| 160 | static void DumpHeader(DumpState* D) | 160 | static void DumpHeader(DumpState* D) |
| 161 | { | 161 | { |
| 162 | lu_byte h[LUAC_HEADERSIZE]; | 162 | DumpBlock(LUA_SIGNATURE,sizeof(LUA_SIGNATURE),D); |
| 163 | luaU_header(h); | 163 | DumpBlock(LUAC_DATA,sizeof(LUAC_DATA),D); |
| 164 | DumpBlock(h,LUAC_HEADERSIZE,D); | 164 | DumpChar(LUAC_VERSION,D); |
| 165 | DumpChar(LUAC_FORMAT,D); | ||
| 166 | DumpChar(sizeof(int),D); | ||
| 167 | DumpChar(sizeof(size_t),D); | ||
| 168 | DumpChar(sizeof(Instruction),D); | ||
| 169 | DumpChar(sizeof(lua_Integer),D); | ||
| 170 | DumpChar(sizeof(lua_Number),D); | ||
| 171 | DumpInteger(LUAC_INT,D); | ||
| 172 | DumpNumber(LUAC_NUM,D); | ||
| 165 | } | 173 | } |
| 166 | 174 | ||
| 167 | /* | 175 | /* |
