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

Eliminates execution path with using uninitialised pointer #21

Merged
merged 2 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/humlib.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Programmer: Craig Stuart Sapp <[email protected]>
// Creation Date: Sat Aug 8 12:24:49 PDT 2015
// Last Modified: Thu Nov 21 16:17:06 WET 2019
// Last Modified: Mon Nov 25 20:49:29 CET 2019
// Filename: humlib.h
// URL: https://github.com/craigsapp/humlib/blob/master/include/humlib.h
// Syntax: C++11
Expand Down
6 changes: 4 additions & 2 deletions src/GridSlice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ bool GridSlice::isDataSlice(void) {
//

void GridSlice::transferTokens(HumdrumFile& outfile, bool recip) {
HTp token;
HTp token = NULL;
HumdrumLine* line = new HumdrumLine;
GridVoice* voice;
string empty = ".";
Expand Down Expand Up @@ -302,7 +302,9 @@ void GridSlice::transferTokens(HumdrumFile& outfile, bool recip) {
} else if (hasSpines()) {
token = new HumdrumToken("55");
empty = "!z";
}
} else if (!token) {
token = new HumdrumToken();
}
if (hasSpines()) {
line->appendToken(token);
}
Expand Down
8 changes: 5 additions & 3 deletions src/humlib.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Programmer: Craig Stuart Sapp <[email protected]>
// Creation Date: Sat Aug 8 12:24:49 PDT 2015
// Last Modified: Thu Nov 21 16:17:06 WET 2019
// Last Modified: Mon Nov 25 20:49:29 CET 2019
// Filename: /include/humlib.cpp
// URL: https://github.com/craigsapp/humlib/blob/master/src/humlib.cpp
// Syntax: C++11
Expand Down Expand Up @@ -5721,7 +5721,7 @@ bool GridSlice::isDataSlice(void) {
//

void GridSlice::transferTokens(HumdrumFile& outfile, bool recip) {
HTp token;
HTp token = NULL;
HumdrumLine* line = new HumdrumLine;
GridVoice* voice;
string empty = ".";
Expand Down Expand Up @@ -5765,7 +5765,9 @@ void GridSlice::transferTokens(HumdrumFile& outfile, bool recip) {
} else if (hasSpines()) {
token = new HumdrumToken("55");
empty = "!z";
}
} else if (!token) {
token = new HumdrumToken();
}
if (hasSpines()) {
line->appendToken(token);
}
Expand Down