[PATCH] D96631: [flang] Detect circularly defined procedures

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 13:29:39 PST 2021


PeteSteinfeld created this revision.
PeteSteinfeld added reviewers: klausler, tskeith.
PeteSteinfeld requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It's possible to define a procedure that has a procedure dummy argument which
names the procedure that contains it.  This was causing the compiler to fall
into an infinite loop when characterizing a call to the procedure.

Following a suggestion from Peter, I fixed this be maintaining a set of
procedure symbols that had already been seen while characterizing a procedure.
This required passing a new parameter to the functions that characterized a
Procedure, a DummyArgument, and a DummyProcedure.

I also added several tests that will crash the compiler without this change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96631

Files:
  flang/include/flang/Evaluate/characteristics.h
  flang/lib/Evaluate/characteristics.cpp
  flang/test/Semantics/resolve100.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96631.323465.patch
Type: text/x-patch
Size: 8481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210212/96616cb0/attachment.bin>


More information about the llvm-commits mailing list