Fix to buffer constructor;

This commit is contained in:
bjorn 2022-04-28 20:26:47 -07:00
parent c285d0cdf9
commit 6ee2b901f7
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ static void luax_checkbufferformat(lua_State* L, int index, BufferInfo* info) {
field->location = lua_isnil(L, -1) ? location++ : luaL_checkinteger(L, -1); // TODO names
lua_pop(L, 1);
} else if (lua_isstring(L, -1)) {
FieldType type = luax_checkfieldtype(L, index);
FieldType type = luax_checkfieldtype(L, -1);
uint32_t align = layout == LAYOUT_PACKED ? fieldInfo[type].scalarAlign : fieldInfo[type].baseAlign;
field->offset = ALIGN(offset, align);
field->location = location++;