-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Symbol key support to WeakMap #56
Conversation
Locally I get a segfault which looks like a UAF, digging... |
Looks like the map record referenced by the Symbol key is corrupted. This does not happen with an object as a key. |
62775ce
to
109e541
Compare
|
Ah I think I know what's going on. Symbols seem to be implemented as atoms with some flags, not as objects. So, by accessing it as an object we are just tinkering around with the surrounding memory I think! @bnoordhuis do you reckon I'm on the right track here? If so, not sure how to continue from here 😅 |
So, a Symbol is not exactly an atom but a JSValue where the .ptr field points to a JSAtomStruct, and that's an alias for JSString (a refcounted object.) It seems like it should Just Work(TM). Let me try locally. |
No description provided.