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

Script Tokens and StringVars rewrite #235

Open
llde opened this issue Aug 11, 2024 · 0 comments
Open

Script Tokens and StringVars rewrite #235

llde opened this issue Aug 11, 2024 · 0 comments

Comments

@llde
Copy link
Owner

llde commented Aug 11, 2024

Analisys for bug #229 revealed that the proper solution for the bug, correctly handling multibyte character inside the string, isn't currently feasible without a lot of change I'm not willing to do inside the 22.x branch.
First of all there is quite the technical debt inside the Script tokens and expression evaluators. Not only the script token pass around the char pointer of the stringVar std::string, with unclear lifetimes, when it may be better to pass the stringVar directly, but also the passed pointer is a raw pointer, that may either leak or be invalid if the referring stringVar is destoryed.
This overrealince of raw pointers make making changes to the string, in particular changes that require to reconstruct the char pointers, to be highly problematic.

Rewriting the Script Token system to handle the object lifetime, using either unique or shared pointers (when refcounting is useful) should be the first pass to properly implement multibyte aware strings

@llde llde added this to the 23.0 milestone Aug 11, 2024
llde added a commit that referenced this issue Aug 12, 2024
…r components to single byte char, provided that the system locale is setted according to the character set required. Stop gap measure for fixing bug #229, until a more proper solution can be implemented for #235
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant