[all-commits] [llvm/llvm-project] af3c72: [flang] Catch (and fix) attempts to create an inva...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed May 17 06:21:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af3c7241df9e274d9944f41e8c174b7580c656dd
      https://github.com/llvm/llvm-project/commit/af3c7241df9e274d9944f41e8c174b7580c656dd
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2023-05-17 (Wed, 17 May 2023)

  Changed paths:
    M flang/include/flang/Semantics/scope.h
    M flang/lib/Semantics/scope.cpp

  Log Message:
  -----------
  [flang] Catch (and fix) attempts to create an invalid source range for a Scope

When Scope::AddSourceRange() is called to extend the scope's source range to
include another snippet from a cooked character stream, add a check to ensure
that the new range is part of the same cooked character stream as the rest
of the scope.

And fix the bug that was causing such invalid source ranges to be created:
a submodule's Scope is a children of its parent's in the Scope tree, but
it may or may not be part of the same source file, and it is certainly
not enclosed in the parent's source range.  So don't propagate Scope
source range expansion from a submodule to its parent.

Differential Revision: https://reviews.llvm.org/D150714




More information about the All-commits mailing list