From ebad7849c364e2345c9c41533fd4339a4bb375aa Mon Sep 17 00:00:00 2001 From: Eric Gallager Date: Thu, 3 Oct 2024 10:38:17 -0400 Subject: [PATCH] Fix code scanning alert no. 687: Multiplication result converted to larger type Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/gdb/f-valprint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gdb/f-valprint.c b/src/gdb/f-valprint.c index 9a20ebe5b..23a56772a 100644 --- a/src/gdb/f-valprint.c +++ b/src/gdb/f-valprint.c @@ -290,8 +290,8 @@ f77_print_array_1(int nss, int ndimensions, struct type *type, { fprintf_filtered(stream, "( "); f77_print_array_1((nss + 1), ndimensions, TYPE_TARGET_TYPE(type), - (valaddr + (i * F77_DIM_OFFSET(nss))), - (address + (i * F77_DIM_OFFSET(nss))), + (valaddr + ((CORE_ADDR)i * F77_DIM_OFFSET(nss))), + (address + ((CORE_ADDR)i * F77_DIM_OFFSET(nss))), stream, format, deref_ref, recurse, pretty, elts); fprintf_filtered(stream, ") "); } @@ -305,8 +305,8 @@ f77_print_array_1(int nss, int ndimensions, struct type *type, i++, (*elts)++) { val_print(TYPE_TARGET_TYPE(type), - (valaddr + i * F77_DIM_OFFSET(ndimensions)), - 0, (address + i * F77_DIM_OFFSET(ndimensions)), + (valaddr + (CORE_ADDR)i * F77_DIM_OFFSET(ndimensions)), + 0, (address + (CORE_ADDR)i * F77_DIM_OFFSET(ndimensions)), stream, format, deref_ref, recurse, pretty); if (i != (F77_DIM_SIZE(nss) - 1))