MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / LoadString

Function LoadString

third-party/lua-5.3.5/src/lundump.c:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

LoadConstantsFunction · 0.70
LoadDebugFunction · 0.70
LoadFunctionFunction · 0.70

Calls 3

LoadByteFunction · 0.85
luaS_newlstrFunction · 0.70
luaS_createlngstrobjFunction · 0.70

Tested by

no test coverage detected