-
Notifications
You must be signed in to change notification settings - Fork 392
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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>
Jenkins build all |
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