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

Add #[track_caller] annotation to some panicy VM functions #331

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

eminence
Copy link
Contributor

This improves the error messages a bit if the the panics are triggered in these functions

While adding new code into vm.rs, I often got the order of the stack mixed up, and would run into one of the panics like pop_quantity() "Expected quantity to be on the top of the stack"

Without #[track_caller], the line number printed in the error message would be the line of the call to panic!(). But with #[track_caller], the line number now points to the caller of the pop_xyz() function, which is a bit more useful

This improves the error messages a bit if the the panics are triggered
in these functions
@sharkdp sharkdp merged commit 376b51e into sharkdp:master Feb 10, 2024
15 checks passed
@sharkdp
Copy link
Owner

sharkdp commented Feb 10, 2024

Thanks

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