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

Enlarge SwitchAnalyzer successor counter #4450

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

andrewcraik
Copy link
Contributor

The switch analyzer currently uses an int8_t counter to count the number
of time a given block is a successor of the swtich/table. This can easily
overflow and result in undefined behaviour by the C++ code. This change
enlarges the compiler to int32_t to prevent this kind of overflow and
improves the assert to ensure a sesnible number is being generated.

Signed-off-by: Andrew Craik [email protected]

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 15, 2019

Could you fix the spelling of "switch" in the commit title and body please?

@vijaysun-omr vijaysun-omr self-assigned this Oct 15, 2019
The switch analyzer currently uses an int8_t counter to count the number
of time a given block is a successor of the swtich/table. This can easily
overflow and result in undefined behaviour by the C++ code. This change
enlarges the compiler to int32_t to prevent this kind of overflow and
improves the assert to ensure a sesnible number is being generated.

Signed-off-by: Andrew Craik <[email protected]>
@andrewcraik andrewcraik changed the title Enlarge SwtichAnalyzer successor counter Enlarge SwitchAnalyzer successor counter Oct 15, 2019
@andrewcraik
Copy link
Contributor Author

Commit amended with spelling fix and fixed PR message as well.

@vijaysun-omr
Copy link
Contributor

@genie-omr build all

@vijaysun-omr
Copy link
Contributor

vijaysun-omr commented Oct 16, 2019

I am fine with the proposed fix.
@Leonardo2718 can you please sign off on the review (assuming you are ok with it) since you have also been looking at this change ?

Copy link
Contributor

@Leonardo2718 Leonardo2718 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@vijaysun-omr vijaysun-omr merged commit f9e2f2d into eclipse-omr:master Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants