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