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

Function LoadConstants

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

Source from the content-addressed store, hash-verified

116
117
118static void LoadConstants (LoadState *S, Proto *f) {
119 int i;
120 int n = LoadInt(S);
121 f->k = luaM_newvector(S->L, n, TValue);
122 f->sizek = n;
123 for (i = 0; i < n; i++)
124 setnilvalue(&f->k[i]);
125 for (i = 0; i < n; i++) {
126 TValue *o = &f->k[i];
127 int t = LoadByte(S);
128 switch (t) {
129 case LUA_TNIL:
130 setnilvalue(o);
131 break;
132 case LUA_TBOOLEAN:
133 setbvalue(o, LoadByte(S));
134 break;
135 case LUA_TNUMFLT:
136 setfltvalue(o, LoadNumber(S));
137 break;
138 case LUA_TNUMINT:
139 setivalue(o, LoadInteger(S));
140 break;
141 case LUA_TSHRSTR:
142 case LUA_TLNGSTR:
143 setsvalue2n(S->L, o, LoadString(S));
144 break;
145 default:
146 lua_assert(0);
147 }
148 }
149}
150
151
152static void LoadProtos (LoadState *S, Proto *f) {

Callers 1

LoadFunctionFunction · 0.70

Calls 5

LoadByteFunction · 0.85
LoadIntegerFunction · 0.85
LoadIntFunction · 0.70
LoadNumberFunction · 0.70
LoadStringFunction · 0.70

Tested by

no test coverage detected