diff options
Diffstat (limited to '')
-rw-r--r-- | ldump.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -116,10 +116,10 @@ static void dumpString (DumpState *D, TString *ts) { | |||
116 | if (ts == NULL) | 116 | if (ts == NULL) |
117 | dumpSize(D, 0); | 117 | dumpSize(D, 0); |
118 | else { | 118 | else { |
119 | const TValue *idx = luaH_getstr(D->h, ts); | 119 | TValue idx; |
120 | if (ttisinteger(idx)) { /* string already saved? */ | 120 | if (luaH_getstr(D->h, ts, &idx) == HOK) { /* string already saved? */ |
121 | dumpSize(D, 1); /* reuse a saved string */ | 121 | dumpSize(D, 1); /* reuse a saved string */ |
122 | dumpInt(D, ivalue(idx)); /* index of saved string */ | 122 | dumpInt(D, ivalue(&idx)); /* index of saved string */ |
123 | } | 123 | } |
124 | else { /* must write and save the string */ | 124 | else { /* must write and save the string */ |
125 | TValue key, value; /* to save the string in the hash */ | 125 | TValue key, value; /* to save the string in the hash */ |
@@ -130,7 +130,7 @@ static void dumpString (DumpState *D, TString *ts) { | |||
130 | D->nstr++; /* one more saved string */ | 130 | D->nstr++; /* one more saved string */ |
131 | setsvalue(D->L, &key, ts); /* the string is the key */ | 131 | setsvalue(D->L, &key, ts); /* the string is the key */ |
132 | setivalue(&value, D->nstr); /* its index is the value */ | 132 | setivalue(&value, D->nstr); /* its index is the value */ |
133 | luaH_finishset(D->L, D->h, &key, idx, &value); /* h[ts] = nstr */ | 133 | luaH_set(D->L, D->h, &key, &value); /* h[ts] = nstr */ |
134 | /* integer value does not need barrier */ | 134 | /* integer value does not need barrier */ |
135 | } | 135 | } |
136 | } | 136 | } |