|
@@ -116,10 +116,10 @@ static void dumpString (DumpState *D, TString *ts) {
|
|
|
if (ts == NULL)
|
|
|
dumpSize(D, 0);
|
|
|
else {
|
|
|
- const TValue *idx = luaH_getstr(D->h, ts);
|
|
|
- if (ttisinteger(idx)) { /* string already saved? */
|
|
|
+ TValue idx;
|
|
|
+ if (luaH_getstr(D->h, ts, &idx) == HOK) { /* string already saved? */
|
|
|
dumpSize(D, 1); /* reuse a saved string */
|
|
|
- dumpInt(D, ivalue(idx)); /* index of saved string */
|
|
|
+ dumpInt(D, ivalue(&idx)); /* index of saved string */
|
|
|
}
|
|
|
else { /* must write and save the string */
|
|
|
TValue key, value; /* to save the string in the hash */
|
|
@@ -130,7 +130,7 @@ static void dumpString (DumpState *D, TString *ts) {
|
|
|
D->nstr++; /* one more saved string */
|
|
|
setsvalue(D->L, &key, ts); /* the string is the key */
|
|
|
setivalue(&value, D->nstr); /* its index is the value */
|
|
|
- luaH_finishset(D->L, D->h, &key, idx, &value); /* h[ts] = nstr */
|
|
|
+ luaH_set(D->L, D->h, &key, &value); /* h[ts] = nstr */
|
|
|
/* integer value does not need barrier */
|
|
|
}
|
|
|
}
|