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

Turn dynamic borrow panics into HostErrors #925

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Jul 4, 2023

Fix #817

I'm still not 100% sure we want this -- a dynamic borrow error usually means there's something structurally wrong with the control pattern calling the function, and this might basically make it "recoverable" in some partial sense where it might be cleaner to panic out to the outermost panic handler -- but in either case if someone triggers one we'll be stuck preserving it for backwards compatibility for all time, and this might be a little easier to preserve?

Anyway, assuming we do, this does it.

@graydon graydon requested a review from sisuresh as a code owner July 4, 2023 01:44
@graydon graydon requested a review from dmkozh July 4, 2023 01:44
@graydon graydon force-pushed the bug-817-dynaimc-borrows-can-panic branch from 39a75b1 to 0dc99b8 Compare July 4, 2023 01:54
@graydon graydon merged commit 8b423d0 into main Jul 4, 2023
8 checks passed
@graydon graydon deleted the bug-817-dynaimc-borrows-can-panic branch July 4, 2023 02:57
graydon added a commit that referenced this pull request Jul 4, 2023
graydon added a commit that referenced this pull request Jul 5, 2023
* Mop up a couple missed cases from PR #925

* Cap vector and map sizes to u32::max

* Cast usize to u64 before multiplying, for platform-consistency.
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.

dynamic borrows can panic
2 participants