aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-arm/op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-arm/op.c b/target-arm/op.c
index fd44a40f83..d7ac6de062 100644
--- a/target-arm/op.c
+++ b/target-arm/op.c
@@ -667,7 +667,7 @@ void OPPROTO op_sarl_T1_T0_cc(void)
if (shift >= 32) {
env->CF = (T1 >> 31) & 1;
T1 = (int32_t)T1 >> 31;
- } else {
+ } else if (shift != 0) {
env->CF = (T1 >> (shift - 1)) & 1;
T1 = (int32_t)T1 >> shift;
}