Merge pull request #141 from cazfi/castalign

Castalign
master
Tomás Guisasola 2022-07-27 13:39:06 -03:00 committed by GitHub
commit b7da7097d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -339,7 +339,7 @@ static int cur_close (lua_State *L) {
** a reference to it on the cursor structure.
*/
static void _pushtable (lua_State *L, cur_data *cur, size_t off) {
int *ref = (int *)((char *)cur + off);
int *ref = (int *)cur + off / sizeof(int);
/* If colnames or coltypes do not exist, create both. */
if (*ref == LUA_NOREF)

View File

@ -248,7 +248,7 @@ static void create_coltypes (lua_State *L, cur_data *cur) {
** a reference to it on the cursor structure.
*/
static void _pushtable (lua_State *L, cur_data *cur, size_t off, creator func) {
int *ref = (int *)((char *)cur + off);
int *ref = (int *)cur + off / sizeof(int);
if (*ref != LUA_NOREF)
lua_rawgeti (L, LUA_REGISTRYINDEX, *ref);
else {