aboutsummaryrefslogtreecommitdiff
path: root/target-sparc
diff options
context:
space:
mode:
Diffstat (limited to 'target-sparc')
-rw-r--r--target-sparc/op.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-sparc/op.c b/target-sparc/op.c
index 7a4bd79575..5fbbd6db0f 100644
--- a/target-sparc/op.c
+++ b/target-sparc/op.c
@@ -926,12 +926,18 @@ void OPPROTO op_mulx_T1_T0(void)
void OPPROTO op_udivx_T1_T0(void)
{
+ if (T1 == 0) {
+ raise_exception(TT_DIV_ZERO);
+ }
T0 /= T1;
FORCE_RET();
}
void OPPROTO op_sdivx_T1_T0(void)
{
+ if (T1 == 0) {
+ raise_exception(TT_DIV_ZERO);
+ }
if (T0 == INT64_MIN && T1 == -1)
T0 = INT64_MIN;
else