mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
LibJS: Ensure shift values in left_shift are modded by 32
This is equivalent to 58d6a2d0192b7860ecb2edb4aa5d36b389213a15 but for the left shift operation.
This commit is contained in:
parent
2c2cf90661
commit
38b8fa8f3e
Notes:
sideshowbarker
2024-07-18 11:11:53 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/38b8fa8f3e2 Pull-request: https://github.com/SerenityOS/serenity/pull/8339
@ -993,7 +993,7 @@ Value left_shift(GlobalObject& global_object, Value lhs, Value rhs)
|
||||
return lhs_numeric;
|
||||
// Ok, so this performs toNumber() again but that "can't" throw
|
||||
auto lhs_i32 = lhs_numeric.to_i32(global_object);
|
||||
auto rhs_u32 = rhs_numeric.to_u32(global_object);
|
||||
auto rhs_u32 = rhs_numeric.to_u32(global_object) % 32;
|
||||
return Value(lhs_i32 << rhs_u32);
|
||||
}
|
||||
if (both_bigint(lhs_numeric, rhs_numeric)) {
|
||||
|
Loading…
Reference in New Issue
Block a user