-
Notifications
You must be signed in to change notification settings - Fork 29
Fix multiple runtime APIs that were incorrectly using std::string::reserve
#478
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
Conversation
…sn/try-fixing-wd-in-docs-job
std::string::reserve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting some small changes, but this broadly looks good to go.
|
Currently also trying to figure out why Windows tests are failing now that I'm trying to re-enable them. Edit: giving up on this for now and reverting these Windows-related changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some style comments, but not blocking.
Problem
Multiple runtime APIs incorrectly were using
std::string::reservewhere they should have been usingstd::string::resize. This led to UB that seemed to behave fine at runtime, but the introduction of #467 caused all of these APIs to break.Solution
We introduce
uvutils::getStringFromUvas a utility API to help reduce errors when interacting with libuv. Internally, this handles all the buffer logic and simply returns a value or an error to the caller.In fixing this, I also discovered two issues with our CI:
path.posix.test.luauis flipped but was mistakenly passing because of the previously brokenprocess.cwd()API.I've fixed (1) and have made a separate issue for (2): #483.