FFI: Compile bitfield loads/stores.

This commit is contained in:
Mike Pall
2017-04-30 23:58:33 +02:00
parent dc5eb65ccf
commit fbfbd7b9e1
2 changed files with 50 additions and 3 deletions

View File

@@ -448,8 +448,10 @@ int lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp)
setintV(o, (int32_t)val);
}
} else {
uint32_t b = (val >> pos) & 1;
lua_assert(bsz == 1);
setboolV(o, (val >> pos) & 1);
setboolV(o, b);
setboolV(&cts->g->tmptv2, b); /* Remember for trace recorder. */
}
return 0; /* No GC step needed. */
}