From 323e1e17cf3cdd7486ac138f6156843fc1b7a255 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 12 Jan 2022 19:59:52 +0100 Subject: [PATCH] LibJS: Fix `sign` data type in parse_temporal_time_zone_string() A sign that's either the value 1 or -1 should obviously not have an unsigned data type :^) This would cause it to become 255 for the negative offset case, which would then completely screw up the offset_nanoseconds calculation as it serves as a multiplier. --- .../Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 9f600c4fb4..0848e97139 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -1638,7 +1638,7 @@ ThrowCompletionOr parse_temporal_time_zone_string(GlobalObject // b. Set hours to ! ToIntegerOrInfinity(hours). u8 hours = *hours_part->to_uint(); - u8 sign; + i8 sign; // c. If sign is the code unit 0x002D (HYPHEN-MINUS) or the code unit 0x2212 (MINUS SIGN), then if (sign_part->is_one_of("-", "\u2212")) { // i. Set sign to −1.