summaryrefslogtreecommitdiff
path: root/src/lj_bcwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_bcwrite.c')
-rw-r--r--src/lj_bcwrite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_bcwrite.c b/src/lj_bcwrite.c
index 27f08fe8..5050da07 100644
--- a/src/lj_bcwrite.c
+++ b/src/lj_bcwrite.c
@@ -324,7 +324,7 @@ static void bcwrite_proto(BCWriteCtx *ctx, GCproto *pt)
324 /* Pass buffer to writer function. */ 324 /* Pass buffer to writer function. */
325 if (ctx->status == 0) { 325 if (ctx->status == 0) {
326 MSize n = ctx->sb.n - 5; 326 MSize n = ctx->sb.n - 5;
327 MSize nn = 1 + lj_fls(n)/7; 327 MSize nn = (lj_fls(n)+8)*9 >> 6;
328 ctx->sb.n = 5 - nn; 328 ctx->sb.n = 5 - nn;
329 bcwrite_uleb128(ctx, n); /* Fill in final size. */ 329 bcwrite_uleb128(ctx, n); /* Fill in final size. */
330 lua_assert(ctx->sb.n == 5); 330 lua_assert(ctx->sb.n == 5);