1 Index: lua-5.1.4/src/ldump.c
2 ===================================================================
3 --- lua-5.1.4.orig/src/ldump.c 2008-08-24 16:48:20.000000000 +0200
4 +++ lua-5.1.4/src/ldump.c 2008-08-24 16:48:52.000000000 +0200
7 if (s==NULL || getstr(s)==NULL)
10 + unsigned int size=0;
15 - size_t size=s->tsv.len+1; /* include trailing '\0' */
16 + unsigned int size=s->tsv.len+1; /* include trailing '\0' */
18 DumpBlock(getstr(s),size,D);
20 Index: lua-5.1.4/src/lundump.c
21 ===================================================================
22 --- lua-5.1.4.orig/src/lundump.c 2008-08-24 16:48:20.000000000 +0200
23 +++ lua-5.1.4/src/lundump.c 2008-08-24 16:48:52.000000000 +0200
31 #ifdef LUAC_TRUST_BINARIES
36 -#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size))
37 #define LoadByte(S) (lu_byte)LoadChar(S)
38 #define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x))
39 #define LoadVector(S,b,n,size) LoadMem(S,b,n,size)
41 IF (r!=0, "unexpected end");
44 +static void LoadMem (LoadState* S, void* b, int n, size_t size)
46 + LoadBlock(S,b,n*size);
58 + c=p[0]; p[0]=p[1]; p[1]=c;
65 + c=p[0]; p[0]=p[3]; p[3]=c;
66 + c=p[1]; p[1]=p[2]; p[2]=c;
73 + c=p[0]; p[0]=p[7]; p[7]=c;
74 + c=p[1]; p[1]=p[6]; p[6]=c;
75 + c=p[2]; p[2]=p[5]; p[5]=c;
76 + c=p[3]; p[3]=p[4]; p[4]=c;
87 static int LoadChar(LoadState* S)
92 static TString* LoadString(LoadState* S)
100 char s[LUAC_HEADERSIZE];
102 LoadBlock(S,s,LUAC_HEADERSIZE);
103 + S->swap=(s[6]!=h[6]); s[6]=h[6];
104 IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header");
108 *h++=(char)LUAC_FORMAT;
109 *h++=(char)*(char*)&x; /* endianness */
110 *h++=(char)sizeof(int);
111 - *h++=(char)sizeof(size_t);
112 + *h++=(char)sizeof(unsigned int);
113 *h++=(char)sizeof(Instruction);
114 *h++=(char)sizeof(lua_Number);