-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix an issue with bad allocation in post #176
Conversation
I confirm that the tests run successfully on Linux. |
Is this fix of #173 ? |
Linked with #173 then |
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.
I have no major issues, I would strongly recommend to protect the static variable with const.
include/mata/nfa.hh
Outdated
@@ -247,7 +251,20 @@ public: | |||
size_t size() const; | |||
|
|||
|
|||
Post & operator[] (State q) | |||
//Post & operator[] (State q) |
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.
Is it worth keeping the code commented out?
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.
no, it was a working version, actually I don't know why the reviewers were assigned automatically
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.
I assigned them manually.
Seems to work all right now
Now it should be done, no more modifications planned. |
What should actually be the name of that function "mutable_post" ?? |
I quite like We could work with something as |
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.
If we are fine with this approach, the implementation seems OK to me.
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.
It looks fine, if we are sure that the current usages of mutable_post
cannot fuck up anything, then we can merge.
In theory, it should not. This PR only makes it more obvious that the underlying structure can be modified. Therefore, one will not use the mutable accessor when they do not want to modify the data structure. Otherwise, using the mutable accessor behaves exactly as it did until now. |
That's true, but this was really easy, and it looks ok. As I was saying at the meeting, I actually like it this more, but I thought it would be harder to do. |
I wholeheartedly agree. I am not against this approach. And as far as I know, I am not aware of any cases where this would not solve our problems. |
Fix of the problem with delta[q] reallocating post and screwing everything.