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

Fixed bug related to missing copy constructor for static_var #51

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

AjayBrahmakshatriya
Copy link
Collaborator

BuildIt had a bug where static_var didn't have a custom copy constructor. As a result when we have code like -

static_var<int> x = y;

where y is also a static_var, the default copy constructor is called. This is mostly OK for copying the internal stored value, but the static_var's tracking tuple is not recorded. As a result the call to the destructor fails trying to pop the tracking tuple off the stack.

This change adds 2 new copy constructors for static_var and static_var. Consequently 2 new operator= also need to be defined, since the copy constructor is user defined.

sample12 has been changed to test this behavior.

@AjayBrahmakshatriya AjayBrahmakshatriya merged commit 21796c2 into BuildIt-lang:master Aug 31, 2023
2 checks passed
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.

1 participant