-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Three coding bugs identified by static analysis #17082
Comments
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Happy to pick this up if still relevant. I'm still quite new so I will likely return with questions. |
Looks like the first bug has now been fixed, but the other two remain. Not sure that the methods |
They are used, at least in MuseScore/src/engraving/dom/chordrest.h Lines 90 to 91 in b38394f
|
But this is |
That's why it is used |
I see what you're saying now, sorry for misunderstanding :) |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks @wizofaus. Haven't had a chance to take a good look yet, aiming to start this week. |
@shoogle apologies, I haven't found the time to work on this, would probably better to assign someone else |
Could someone clarify what exactly we want to achieve for each bug? |
Issue type
Other type of issue
Bug description
Coding bugs identified by this video https://www.youtube.com/watch?v=SAVbpFTj81I
The video is a year old so some of the errors don't exist anymore.
Steps to reproduce
These are the ones that are still active:
Bug at 01:11
i-i
is always zeroMuseScore/src/engraving/libmscore/textbase.cpp
Line 1888 in fae324d
Bug at 01:17
Functions are identical
MuseScore/src/engraving/libmscore/rest.cpp
Lines 735 to 753 in fae324d
Bug at 2m33
destinationMeasure
is dereferrenced with->
in multiple places without first checking fornullptr
. Same goes for a few other variables in that function.MuseScore/src/engraving/libmscore/score.cpp
Lines 4668 to 4713 in fae324d
And there are also some negated assignments within the
if
conditionsif (!(foo = foo->bar))
which aren't exactly easy to follow. Specifically for these lines,destinationMeasure
is guaranteed to benullptr
when it is dereferenced on the second line because of the condition on the line above.MuseScore/src/engraving/libmscore/score.cpp
Lines 4704 to 4705 in fae324d
Screenshots/Screen recordings
No response
MuseScore Version
Latest code on master
Regression
No.
Operating system
All
Additional context
No response
The text was updated successfully, but these errors were encountered: