summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'target-arm')
-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 656b5df9e..021d121df 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;
}