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

Fixes to type propagation of arithmetic expressions #1449

Merged
merged 9 commits into from
Mar 8, 2024

Conversation

robinmaisch
Copy link
Contributor

@robinmaisch robinmaisch commented Mar 7, 2024

Concerning #1444 (and more small problems came up when dealing with it):

  • BinaryOperators with the operator code %, ||, &&, and >>> are now typed correctly. I could verify that the propagation is valid for the first three in all supported languages, and for >>>, the left operand type is used, like with the other bit shift operators.
  • Java float literals, indicated by the flag f or F, now get the FloatingPointType for floats instead of doubles. The JavaParser library does not differentiate between float and double literals, so a manual check is necessary.
  • the type propagation of BooleanType binary operations is now included in arithmeticOpTypePropagation, as BooleanType is a subclass of NumericType.
  • simplified the resulting logic of propagateTypeOfBinaryOperation a bit, as arithmeticOpTypePropagation can already handle invalid cases
  • Modified a test that fails under Windows because of hardcoded Linux path separators
  • Added a test for the above changes
  • Added a test file for the test

@CLAassistant
Copy link

CLAassistant commented Mar 7, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@konradweiss konradweiss left a comment

Choose a reason for hiding this comment

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

LGTM

@oxisto oxisto merged commit 2da3c9e into Fraunhofer-AISEC:main Mar 8, 2024
3 checks passed
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.

4 participants