I3N2W6: fix overflow when strength reducing interger multiply

This commit is contained in:
kuenking111 2021-04-20 21:11:22 +08:00
parent f8427a2ebb
commit c574f34416

View File

@ -12,11 +12,11 @@ index 6d0b4acbd..ecd4bd4a6 100644
- right.load_item();
+ jint c = right.get_jint_constant();
+ if (c > 0 && c < max_jint && (is_power_of_2(c) || is_power_of_2(c - 1) || is_power_of_2(c + 1))) {
+ right.dont_load_item();
+ right_arg->dont_load_item();
} else {
- right.dont_load_item();
+ // Cannot use constant op.
+ right_arg->load_item();
+ right_arg->load_item();
}
} else {
right.load_item();