| 141 | #define toproto(L,i) getproto(s2v(L->top+(i))) |
| 142 | |
| 143 | static const Proto* combine(lua_State* L, int n) |
| 144 | { |
| 145 | if (n==1) |
| 146 | return toproto(L,-1); |
| 147 | else |
| 148 | { |
| 149 | Proto* f; |
| 150 | int i=n; |
| 151 | if (lua_load(L,reader,&i,"=(" PROGNAME ")",NULL)!=LUA_OK) fatal(lua_tostring(L,-1)); |
| 152 | f=toproto(L,-1); |
| 153 | for (i=0; i<n; i++) |
| 154 | { |
| 155 | f->p[i]=toproto(L,i-n-1); |
| 156 | if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; |
| 157 | } |
| 158 | f->sizelineinfo=0; |
| 159 | return f; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | static int writer(lua_State* L, const void* p, size_t size, void* u) |
| 164 | { |