!143 I3N2W6: fix overflow when strength reducing interger multiply

From: @kuenking111
Reviewed-by: @jvmboy
Signed-off-by: @jvmboy
This commit is contained in:
openeuler-ci-bot 2021-04-21 09:21:44 +08:00 committed by Gitee
commit aef662b352

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();