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

Skip enum NumOMRTypes in for loop #6474

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Skip enum NumOMRTypes in for loop #6474

merged 1 commit into from
Jun 17, 2022

Conversation

jamesgua
Copy link
Contributor

in the for loop when DataType greater than Aggregate and still no conversion found, this will avoid assertion failure in OMRDataTypes

Signed-off-by: Tao Guan james_mango@yahoo.com

@@ -579,6 +579,11 @@ bool decodeConversionOpcode(TR::ILOpCode op, TR::DataType nodeDataType, TR::Data
TR::ILOpCodes opValue = op.getOpCodeValue();
for (int i = 0; i < TR::NumAllTypes; i++)
{
if(TR::NumOMRTypes == i)
{
i++; // skip it
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the increment is necessary (or correct for that matter).

Copy link
Contributor Author

@jamesgua jamesgua Apr 21, 2022

Choose a reason for hiding this comment

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

For opcode bu2l it has property ILProp1::Conversion but not shown in conversionMap, so it will lead to assertion failure. So far there're 66 opcodes have the property but a lot less shown in conversionMap, maybe in future there will be more places have such range of data type check, then a better solution would be in need.

Copy link
Contributor

Choose a reason for hiding this comment

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

My comment wasn't about whether skipping this entry is necessary, but whether you need to do an explicit increment to achieve that. If all you're doing is skipping the TR::NumOMRTypes entry then the continue should take care of that for you. Unless I'm missing some subtlety here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, my mistake. Now updated with continue only to skip it. Thx!

@@ -579,6 +579,11 @@ bool decodeConversionOpcode(TR::ILOpCode op, TR::DataType nodeDataType, TR::Data
TR::ILOpCodes opValue = op.getOpCodeValue();
for (int i = 0; i < TR::NumAllTypes; i++)
{
if(TR::NumOMRTypes == i)
Copy link
Contributor

Choose a reason for hiding this comment

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

Space needed after if

  avoid assertion failure in OMRDataTypes

Signed-off-by: Tao Guan <james_mango@yahoo.com>
@0xdaryl
Copy link
Contributor

0xdaryl commented May 24, 2022

Jenkins build all

@0xdaryl 0xdaryl self-assigned this May 24, 2022
@0xdaryl 0xdaryl merged commit 838e728 into eclipse:master Jun 17, 2022
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.

None yet

2 participants