diff --git a/src/ltable.c b/src/ltable.c
index d080189..b1c1469 100644
--- a/src/ltable.c
+++ b/src/ltable.c
@@ -337,10 +337,14 @@ void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
unsigned int oldasize = t->sizearray;
int oldhsize = allocsizenode(t);
Node *nold = t->node; /* save old hash ... */
- if (nasize > oldasize) /* array part must grow? */
- setarrayvector(L, t, nasize);
/* create new hash part with appropriate size */
setnodevector(L, t, nhsize);
+ if (nasize > oldasize) { /* array part must grow? */
+ Node *temp = t->node;
+ t->node = nold;
+ setarrayvector(L, t, nasize);
+ t->node = temp;
+ }
if (nasize < oldasize) { /* array part must shrink? */
t->sizearray = nasize;
/* re-insert elements from vanishing slice */
It may cause a memory leak when the issue triggered , but no inconsistent state on the table.