Skip to content
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

Symbol() segfaults #318

Closed
bnoordhuis opened this issue Sep 21, 2024 · 0 comments · Fixed by #319
Closed

Symbol() segfaults #318

bnoordhuis opened this issue Sep 21, 2024 · 0 comments · Fixed by #319
Labels
bug/crash Bugs specific to crashes, segfaults, etc. Gem can be installed though.

Comments

@bnoordhuis
Copy link
Collaborator

require "mini_racer"
MiniRacer::Context.new.eval("Symbol()") # segfaults, no description
@bnoordhuis bnoordhuis added the bug/crash Bugs specific to crashes, segfaults, etc. Gem can be installed though. label Sep 21, 2024
bnoordhuis added a commit to bnoordhuis/mini_racer that referenced this issue Sep 21, 2024
Symbol::Description() normally returns a string, but when the symbol
does not have a description, it returns undefined.

The String::Utf8Value constructor requires that a v8::Context is active
for the ToString operation it executes. ToString is a no-op for strings
(hence no crash) but not for undefined.

Add a Context::Scope to fix that.

Fixes: rubyjs#318
bnoordhuis added a commit that referenced this issue Sep 21, 2024
Symbol::Description() normally returns a string, but when the symbol
does not have a description, it returns undefined.

The String::Utf8Value constructor requires that a v8::Context is active
for the ToString operation it executes. ToString is a no-op for strings
(hence no crash) but not for undefined.

Add a Context::Scope to fix that.

Fixes: #318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/crash Bugs specific to crashes, segfaults, etc. Gem can be installed though.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant