MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / LoadString

Function LoadString

src/Chain/libraries/glua/lundump.cpp:93–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92
93static TString *LoadString(LoadState *S) {
94 size_t size = LoadByte(S);
95 if (size == 0xFF)
96 LoadVar(S, size);
97 if (size == 0)
98 return nullptr;
99 else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */
100 char buff[LUAI_MAXSHORTLEN];
101 LoadVector(S, buff, size);
102 return luaS_newlstr(S->L, buff, size);
103 }
104 else { /* long string */
105 TString *ts = luaS_createlngstrobj(S->L, size);
106 LoadVector(S, getstr(ts), size); /* load directly in final place */
107 return ts;
108 }
109}
110
111// 500M
112const int g_sizelimit = 1024 * 1024 * 500;

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