| 93 | |
| 94 | |
| 95 | static TString *LoadString (LoadState *S) { |
| 96 | size_t size = LoadByte(S); |
| 97 | if (size == 0xFF) |
| 98 | LoadVar(S, size); |
| 99 | if (size == 0) |
| 100 | return NULL; |
| 101 | else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */ |
| 102 | char buff[LUAI_MAXSHORTLEN]; |
| 103 | LoadVector(S, buff, size); |
| 104 | return luaS_newlstr(S->L, buff, size); |
| 105 | } |
| 106 | else { /* long string */ |
| 107 | TString *ts = luaS_createlngstrobj(S->L, size); |
| 108 | LoadVector(S, getstr(ts), size); /* load directly in final place */ |
| 109 | return ts; |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | |
| 114 | static void LoadCode (LoadState *S, Proto *f) { |
no test coverage detected