summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/mathop.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/mathop.h')
-rw-r--r--Build/source/utils/asymptote/mathop.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Build/source/utils/asymptote/mathop.h b/Build/source/utils/asymptote/mathop.h
index 97772d8e799..572a9f7ee1b 100644
--- a/Build/source/utils/asymptote/mathop.h
+++ b/Build/source/utils/asymptote/mathop.h
@@ -143,7 +143,8 @@ struct times<Int> {
Int operator() (Int x, Int y, size_t i=0) {
if(y == 0) return 0;
if(y < 0) {y=-y; x=-x;}
- if(x > Int_MAX/y || x < Int_MIN/y)
+ if((y > int_MAX || x > int_MAX/(int) y || x < int_MIN/(int) y) &&
+ (x > Int_MAX/y || x < Int_MIN/y))
integeroverflow(i);
return x*y;
}