[PATCH] Do not dereference NULL pointer in resolve_ref (PR fortran/89185).

Martin Liška mliska@suse.cz
Mon Feb 4 12:46:00 GMT 2019


Hi.

In r268092 there was added a code that guard the loop
in resolve_ref. Unfortunately, one needs to prevent execution
of 'prev = &(*prev)->next' that happens before the loop guard check.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/fortran/ChangeLog:

2019-02-04  Martin Liska  <mliska@suse.cz>

	PR fortran/89185
	* resolve.c (resolve_ref): Remove breakout variable as
	we need to prevent prev = &(*prev)->next to happen
	with *prev == NULL.
---
 gcc/fortran/resolve.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-not-dereference-NULL-pointer-in-resolve_ref-PR-fo.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20190204/5b790d8a/attachment.bin>


More information about the Fortran mailing list