MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / LoadString

Function LoadString

Plugins/slua_unreal/External/lua/lundump.cpp:87–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86
87static 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
106static void LoadCode (LoadState *S, Proto *f) {

Callers 3

LoadConstantsFunction · 0.85
LoadDebugFunction · 0.85
LoadFunctionFunction · 0.85

Calls 3

LoadByteFunction · 0.85
luaS_newlstrFunction · 0.85
luaS_createlngstrobjFunction · 0.85

Tested by

no test coverage detected