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

feat(heap): Make number and string allocation functions unsafe #60

Merged
merged 10 commits into from
Nov 1, 2023

Conversation

aapoalas
Copy link
Collaborator

These functions do not check the invariants that the parameters must keep to, so they're naturally unsafe.

I had to also refactor the way the Number enum is instantiated.

Copy link
Contributor

@sno2 sno2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

nova_vm/src/heap/number.rs Outdated Show resolved Hide resolved
),
ObjectEntry::new(
PropertyKey::from_str(heap, "MIN_SAFE_INTEGER"),
PropertyDescriptor::roh(Value::from_f64(heap, -9007199254740991.0)),
PropertyDescriptor::roh(heap.create(-9007199254740991.0).into()),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

nova_vm/src/heap/symbol.rs Outdated Show resolved Hide resolved
@aapoalas aapoalas force-pushed the feat/unsafe-heap-alloc-functions branch from 17e2101 to 88ab98a Compare November 1, 2023 20:50
@aapoalas aapoalas merged commit a3e0e14 into main Nov 1, 2023
1 check passed
@aapoalas aapoalas deleted the feat/unsafe-heap-alloc-functions branch November 1, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants