aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-arm/helper.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 656b5df9ec..021d121df9 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -402,6 +402,8 @@ int32_t HELPER(sdiv)(int32_t num, int32_t den)
{
if (den == 0)
return 0;
+ if (num == INT_MIN && den == -1)
+ return INT_MIN;
return num / den;
}