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

Update a test expression to fix a logical short circuit #339

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Update a test expression to fix a logical short circuit #339

merged 1 commit into from
Sep 20, 2023

Conversation

munahaf
Copy link
Contributor

@munahaf munahaf commented Sep 20, 2023

In file: unstructured_mesh.py, method: __get_inner_product_projection_matrices, a logical equality check operation was performed with the same operand on both sides. The comparison operation always returns either true or false. Such logical short circuits in code lead to unintended behavior.

I think this was probably a typo as a similar check is done in a different way in many other parts of the same code. I suggested that the logical operation should be reviewed for correctness.

Sponsorship and Support:

This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed – to improve global software supply chain security.

The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #339 (926d997) into main (8b52e27) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #339   +/-   ##
=======================================
  Coverage   85.47%   85.47%           
=======================================
  Files          39       39           
  Lines       12001    12001           
=======================================
  Hits        10258    10258           
  Misses       1743     1743           
Files Changed Coverage Δ
discretize/unstructured_mesh.py 99.69% <100.00%> (ø)

Copy link
Member

@jcapriot jcapriot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching this!

@jcapriot jcapriot merged commit 8fe0779 into simpeg:main Sep 20, 2023
14 checks passed
openrefactorymunawar pushed a commit to OR-TestUser/discretize that referenced this pull request Jan 11, 2024
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.

2 participants