mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1087873: Fix signed/unsigned comparisons in Shuffle/Swizzle; r=till
This commit is contained in:
parent
46ab9cf831
commit
5da791e34e
@ -712,14 +712,14 @@ Swizzle(JSContext *cx, unsigned argc, Value *vp)
|
|||||||
if (args.length() != (V::lanes + 1) || !IsVectorObject<V>(args[0]))
|
if (args.length() != (V::lanes + 1) || !IsVectorObject<V>(args[0]))
|
||||||
return ErrorBadArgs(cx);
|
return ErrorBadArgs(cx);
|
||||||
|
|
||||||
int32_t lanes[V::lanes];
|
uint32_t lanes[V::lanes];
|
||||||
for (unsigned i = 0; i < V::lanes; i++) {
|
for (unsigned i = 0; i < V::lanes; i++) {
|
||||||
int32_t lane = -1;
|
int32_t lane = -1;
|
||||||
if (!ToInt32(cx, args[i + 1], &lane))
|
if (!ToInt32(cx, args[i + 1], &lane))
|
||||||
return false;
|
return false;
|
||||||
if (lane < 0 || lane >= V::lanes)
|
if (lane < 0 || uint32_t(lane) >= V::lanes)
|
||||||
return ErrorBadArgs(cx);
|
return ErrorBadArgs(cx);
|
||||||
lanes[i] = lane;
|
lanes[i] = uint32_t(lane);
|
||||||
}
|
}
|
||||||
|
|
||||||
Elem *val = TypedObjectMemory<Elem *>(args[0]);
|
Elem *val = TypedObjectMemory<Elem *>(args[0]);
|
||||||
@ -741,14 +741,14 @@ Shuffle(JSContext *cx, unsigned argc, Value *vp)
|
|||||||
if (args.length() != (V::lanes + 2) || !IsVectorObject<V>(args[0]) || !IsVectorObject<V>(args[1]))
|
if (args.length() != (V::lanes + 2) || !IsVectorObject<V>(args[0]) || !IsVectorObject<V>(args[1]))
|
||||||
return ErrorBadArgs(cx);
|
return ErrorBadArgs(cx);
|
||||||
|
|
||||||
int32_t lanes[V::lanes];
|
uint32_t lanes[V::lanes];
|
||||||
for (unsigned i = 0; i < V::lanes; i++) {
|
for (unsigned i = 0; i < V::lanes; i++) {
|
||||||
int32_t lane = -1;
|
int32_t lane = -1;
|
||||||
if (!ToInt32(cx, args[i + 2], &lane))
|
if (!ToInt32(cx, args[i + 2], &lane))
|
||||||
return false;
|
return false;
|
||||||
if (lane < 0 || lane >= (2 * V::lanes))
|
if (lane < 0 || uint32_t(lane) >= (2 * V::lanes))
|
||||||
return ErrorBadArgs(cx);
|
return ErrorBadArgs(cx);
|
||||||
lanes[i] = lane;
|
lanes[i] = uint32_t(lane);
|
||||||
}
|
}
|
||||||
|
|
||||||
Elem *lhs = TypedObjectMemory<Elem *>(args[0]);
|
Elem *lhs = TypedObjectMemory<Elem *>(args[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user