diff options
-rw-r--r-- | src/lj_bcwrite.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_bcwrite.c b/src/lj_bcwrite.c index 6282f767..9820ad12 100644 --- a/src/lj_bcwrite.c +++ b/src/lj_bcwrite.c | |||
@@ -124,7 +124,7 @@ static void bcwrite_ktab(BCWriteCtx *ctx, const GCtab *t) | |||
124 | MSize i, hmask = t->hmask; | 124 | MSize i, hmask = t->hmask; |
125 | Node *node = noderef(t->node); | 125 | Node *node = noderef(t->node); |
126 | for (i = 0; i <= hmask; i++) | 126 | for (i = 0; i <= hmask; i++) |
127 | nhash += !tvisnil(&node[i].val); | 127 | nhash += !tvisnil(&node[i].key); |
128 | } | 128 | } |
129 | /* Write number of array slots and hash slots. */ | 129 | /* Write number of array slots and hash slots. */ |
130 | bcwrite_uleb128(ctx, narray); | 130 | bcwrite_uleb128(ctx, narray); |
@@ -139,7 +139,7 @@ static void bcwrite_ktab(BCWriteCtx *ctx, const GCtab *t) | |||
139 | MSize i = nhash; | 139 | MSize i = nhash; |
140 | Node *node = noderef(t->node) + t->hmask; | 140 | Node *node = noderef(t->node) + t->hmask; |
141 | for (;; node--) | 141 | for (;; node--) |
142 | if (!tvisnil(&node->val)) { | 142 | if (!tvisnil(&node->key)) { |
143 | bcwrite_ktabk(ctx, &node->key, 0); | 143 | bcwrite_ktabk(ctx, &node->key, 0); |
144 | bcwrite_ktabk(ctx, &node->val, 1); | 144 | bcwrite_ktabk(ctx, &node->val, 1); |
145 | if (--i == 0) break; | 145 | if (--i == 0) break; |