* [Committed] PR fortran/104999 - [12 Regression] runtime error: pointer index expression with base 0x00000cf67720 overflowed to 0xffffffffea627728
@ 2022-03-22 20:05 Harald Anlauf
0 siblings, 0 replies; only message in thread
From: Harald Anlauf @ 2022-03-22 20:05 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
Dear all,
as reported by Martin Liška, a sanitized compiler hits an uninitialized stride
value when simplifying CSHIFT in testcase gfortran.dg/simplify_cshift_1.f90.
Committed as obvious after confirmation in the PR by Martin that the attached
patch fixes the issue.
commit r12-7771-g774ab2edcb5f3a24ed3a5cffd1143bd49a69f1ee
Thanks,
Harald
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pr104999.diff --]
[-- Type: text/x-patch, Size: 819 bytes --]
From 774ab2edcb5f3a24ed3a5cffd1143bd49a69f1ee Mon Sep 17 00:00:00 2001
From: Harald Anlauf <anlauf@gmx.de>
Date: Tue, 22 Mar 2022 20:54:18 +0100
Subject: [PATCH] Fortran: ensure intialization of stride array
gcc/fortran/ChangeLog:
PR fortran/104999
* simplify.cc (gfc_simplify_cshift): Ensure temporary holding
source array stride is initialized.
---
gcc/fortran/simplify.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc
index 0c15bcb2b0a..233cc42137f 100644
--- a/gcc/fortran/simplify.cc
+++ b/gcc/fortran/simplify.cc
@@ -2134,6 +2134,7 @@ gfc_simplify_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
resultvec = XCNEWVEC (gfc_expr *, arraysize);
+ sstride[0] = 0;
extent[0] = 1;
count[0] = 0;
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-22 20:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 20:05 [Committed] PR fortran/104999 - [12 Regression] runtime error: pointer index expression with base 0x00000cf67720 overflowed to 0xffffffffea627728 Harald Anlauf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).