| 85 | |
| 86 | |
| 87 | static TString *LoadString (LoadState *S) { |
| 88 | int size = LoadByte(S); |
| 89 | if (size == 0xFF) |
| 90 | LoadVar(S, size); |
| 91 | if (size == 0) |
| 92 | return NULL; |
| 93 | else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */ |
| 94 | char buff[LUAI_MAXSHORTLEN]; |
| 95 | LoadVector(S, buff, size); |
| 96 | return luaS_newlstr(S->L, buff, size); |
| 97 | } |
| 98 | else { /* long string */ |
| 99 | TString *ts = luaS_createlngstrobj(S->L, size); |
| 100 | LoadVector(S, getstr(ts), size); /* load directly in final place */ |
| 101 | return ts; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | |
| 106 | static void LoadCode (LoadState *S, Proto *f) { |
no test coverage detected