diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_bcwrite.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_bcwrite.c b/src/lj_bcwrite.c index c062dc49..ddfa46c5 100644 --- a/src/lj_bcwrite.c +++ b/src/lj_bcwrite.c | |||
| @@ -133,7 +133,7 @@ static void bcwrite_ktab_sorted_hash(BCWriteCtx *ctx, Node *node, MSize nhash) | |||
| 133 | TValue **heap = ctx->heap; | 133 | TValue **heap = ctx->heap; |
| 134 | MSize i = nhash; | 134 | MSize i = nhash; |
| 135 | for (;; node--) { /* Build heap. */ | 135 | for (;; node--) { /* Build heap. */ |
| 136 | if (!tvisnil(&node->val)) { | 136 | if (!tvisnil(&node->key)) { |
| 137 | bcwrite_ktabk_heap_insert(heap, --i, nhash, &node->key); | 137 | bcwrite_ktabk_heap_insert(heap, --i, nhash, &node->key); |
| 138 | if (i == 0) break; | 138 | if (i == 0) break; |
| 139 | } | 139 | } |
| @@ -163,7 +163,7 @@ static void bcwrite_ktab(BCWriteCtx *ctx, char *p, const GCtab *t) | |||
| 163 | MSize i, hmask = t->hmask; | 163 | MSize i, hmask = t->hmask; |
| 164 | Node *node = noderef(t->node); | 164 | Node *node = noderef(t->node); |
| 165 | for (i = 0; i <= hmask; i++) | 165 | for (i = 0; i <= hmask; i++) |
| 166 | nhash += !tvisnil(&node[i].val); | 166 | nhash += !tvisnil(&node[i].key); |
| 167 | } | 167 | } |
| 168 | /* Write number of array slots and hash slots. */ | 168 | /* Write number of array slots and hash slots. */ |
| 169 | p = lj_strfmt_wuleb128(p, narray); | 169 | p = lj_strfmt_wuleb128(p, narray); |
| @@ -184,7 +184,7 @@ static void bcwrite_ktab(BCWriteCtx *ctx, char *p, const GCtab *t) | |||
| 184 | } else { | 184 | } else { |
| 185 | MSize i = nhash; | 185 | MSize i = nhash; |
| 186 | for (;; node--) | 186 | for (;; node--) |
| 187 | if (!tvisnil(&node->val)) { | 187 | if (!tvisnil(&node->key)) { |
| 188 | bcwrite_ktabk(ctx, &node->key, 0); | 188 | bcwrite_ktabk(ctx, &node->key, 0); |
| 189 | bcwrite_ktabk(ctx, &node->val, 1); | 189 | bcwrite_ktabk(ctx, &node->val, 1); |
| 190 | if (--i == 0) break; | 190 | if (--i == 0) break; |
