Commit ae034cf
authored
fix: use same hash seed when creating VM for shared tables (#2122)
When creating a new Lua VM to load shared tables, use the same hash
seed from the parent VM instead of generating a new random seed.
Different VMs have different hash seeds, causing identical strings to
have different hash values. When looking up string keys in a shared
table from another VM, the hash-based bucket lookup fails because the
search key's hash doesn't match the stored key's hash.
Solution: Pass G(L)->seed to lua_newstate() instead of using
luaL_newstate() which generates a new random seed each time.1 parent 022c619 commit ae034cf
File tree
1 file changed
+1
-1
lines changed- lualib-src
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
0 commit comments