-
Notifications
You must be signed in to change notification settings - Fork 0
Fix fast jit coverity issues #591
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
Conversation
| bh_assert(no >= 0 && (uint32)no < sizeof(regs_i32) / sizeof(regs_i32[0])) | ||
| #define CHECK_I32_REG_NO(no) \ | ||
| do { \ | ||
| if (!(no >= 0 && (uint32)no < sizeof(regs_i32) / sizeof(regs_i32[0]))) \ |
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.
| if (!(no >= 0 && (uint32)no < sizeof(regs_i32) / sizeof(regs_i32[0]))) \ | |
| if ((uint32)no >= sizeof(regs_i32) / sizeof(regs_i32[0]))) \ |
just realized, may be we can simplify the condition.
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.
OK, sounds better.
| case JIT_REG_KIND_F32: | ||
| { | ||
| ASSERT_F32_REG_NO(floatpoint_reg_index); | ||
| CHECK_F32_REG_NO((int32)floatpoint_reg_index); |
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.
maybe int8 floatpoint_reg_index = 0; -> int floatpoint_reg_no = 0
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.
OK
lum1n0us
left a comment
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.
Btw, if maybe a little heavy when we are sure register allocation always give valid register numbers?
It is just for debug version, in release version, CHECK_REG_NO is defined as (void)0. |
No description provided.