--- a/quickjs.c +++ b/quickjs.c @@ -10771,7 +10771,7 @@ static int JS_ToInt64SatFree(JSContext * } else { if (d < INT64_MIN) *pres = INT64_MIN; - else if (d > INT64_MAX) + else if (d > (double)INT64_MAX) *pres = INT64_MAX; else *pres = (int64_t)d; @@ -55329,7 +55329,7 @@ static JSValue js_atomics_wait(JSContext } if (JS_ToFloat64(ctx, &d, argv[3])) return JS_EXCEPTION; - if (isnan(d) || d > INT64_MAX) + if (isnan(d) || d > (double)INT64_MAX) timeout = INT64_MAX; else if (d < 0) timeout = 0;