Skip to content

Fix undefined behavior in element.cpp#45

Open
axelfeldmann wants to merge 1 commit intojackwadden:masterfrom
axelfeldmann:master
Open

Fix undefined behavior in element.cpp#45
axelfeldmann wants to merge 1 commit intojackwadden:masterfrom
axelfeldmann:master

Conversation

@axelfeldmann
Copy link

Previously, clearInputs() is declared as:

bool clearInputs(); in include/element.h.

However, in its definition in src/element.cpp, it does not actually have a return statement. This is undefined behavior and causes crashes when compiled using gcc 11.4 (and probably many other versions too!)

This PR changes the type of clearInputs() to a void function to fix this undefined behavior.

It also makes a similar (though less critical) fix to convertThreshold in MNRLAdapter.cpp.

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