File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -40943,16 +40943,16 @@ static double js_math_fround(double a)
4094340943static JSValue js_math_imul(JSContext *ctx, JSValue this_val,
4094440944 int argc, JSValue *argv)
4094540945{
40946- int a, b;
40946+ uint32_t a, b, c;
40947+ int32_t d;
4094740948
40948- if (JS_ToInt32 (ctx, &a, argv[0]))
40949+ if (JS_ToUint32 (ctx, &a, argv[0]))
4094940950 return JS_EXCEPTION;
40950- if (JS_ToInt32 (ctx, &b, argv[1]))
40951+ if (JS_ToUint32 (ctx, &b, argv[1]))
4095140952 return JS_EXCEPTION;
40952- /* TODO(bnoordhuis) Signed integral narrowing has implementation-defined
40953- * behavior but that's a step up from the undefined behavior it replaced.
40954- */
40955- return js_int32((int64_t)a * (int64_t)b);
40953+ c = a * b;
40954+ memcpy(&d, &c, sizeof(d));
40955+ return js_int32(d);
4095640956}
4095740957
4095840958static JSValue js_math_clz32(JSContext *ctx, JSValue this_val,
You can’t perform that action at this time.
0 commit comments