Skip to content

Commit 6455bf9

Browse files
Jake ChampionJakeChampion
authored andcommitted
assert the Slots::Usages value can fit in a uint8_t
1 parent 800fb66 commit 6455bf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

c-dependencies/js-compute-runtime/builtins/crypto-key.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ bool CryptoKey::usages_get(JSContext *cx, unsigned argc, JS::Value *vp) {
315315
}
316316
// Else, grab the CryptoKeyUsages value from Slots::Usages and convert
317317
// it into a JS Array and store the result in Slots::UsagesArray.
318-
auto usage = CryptoKeyUsages(JS::GetReservedSlot(self, Slots::Usages).toInt32());
318+
auto usage = CryptoKeyUsages(static_cast<uint8_t>(JS::GetReservedSlot(self, Slots::Usages).toInt32()));
319319
// The result is ordered alphabetically.
320320
JS::RootedValueVector result(cx);
321321
JS::RootedString str(cx);

0 commit comments

Comments
 (0)