fix: overflow before widen
To avoid overflow before widen:
- Explicitly cast the operation to 64-bit in the
GIC driver code.
- Use UINT64_C(1) to define a 64-bit wide bitfield.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I930857acaae52e295d769750ac5e9fe42aa3458b
diff --git a/src/manifest.c b/src/manifest.c
index 2ccdf96..44436df 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -102,7 +102,7 @@
}
i = boot_order / BOOT_ORDER_ENTRY_BITS;
- boot_order_mask = 1 << (boot_order % BOOT_ORDER_ENTRY_BITS);
+ boot_order_mask = UINT64_C(1) << (boot_order % BOOT_ORDER_ENTRY_BITS);
if ((boot_order_mask & manifest_data->boot_order_values[i]) != 0U) {
dlog_error("Boot order must be a unique value.");