llvm-project/flang/lib/Semantics
Peter Steinfeld cfd7d8123a [flang] Fix bad dereference of NULLIFY pointer object
When we have a subprogram that has been determined to contain errors, we do not
perform name resolution on its execution part.  In this case, if the subprogram
contains a NULLIFY statement, the parser::Name of a pointer object in a NULLIFY
statement will not have had name resolution performed on it.  Thus, its symbol
will not have been set.  Later, however, we do semantic checking on the NULLIFY
statement.  The code that did this assumed that the parser::Name of the
pointer object was non-null.

I fixed this by just removing the null pointer check for the "symbol" member of
the "parser::Name" of the pointer object when doing semantic checking for
NULLIFY statements.  I also added a test that will make the compiler crash
without this change.

Differential Revision: https://reviews.llvm.org/D98184
2021-03-08 15:01:36 -08:00
..
CMakeLists.txt [flang] Implement derived type description table encoding 2020-12-08 10:26:58 -08:00
assignment.cpp [flang][nfc] Fix comments, remove needless API, tweak script 2021-01-22 10:55:53 -08:00
assignment.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
attr.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
canonicalize-acc.cpp [flang][openacc] Add missing loop construct restriction and validity tests 2020-12-08 14:12:12 -05:00
canonicalize-acc.h [flang][openacc] Semantic checks for OpenACC 3.0 clauses validity 2020-07-14 20:44:35 -04:00
canonicalize-do.cpp [flang][NFC] Get formatting in sync with latest clang-format 2020-07-01 16:51:46 -07:00
canonicalize-do.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
canonicalize-omp.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
canonicalize-omp.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-acc-structure.cpp [flang][directive] Enforce basic semantic check for all clauses 2021-02-01 13:33:30 -05:00
check-acc-structure.h [flang][directive] Enforce basic semantic check for all clauses 2021-02-01 13:33:30 -05:00
check-allocate.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-allocate.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-arithmeticif.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-arithmeticif.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-call.cpp [flang] Improve shape & length characterization 2021-01-30 16:14:27 -08:00
check-call.h [flang] Document and use intrinsic subroutine argument intents 2020-10-20 14:09:46 +02:00
check-case.cpp [flang] Fix integer CASE constant typing 2020-09-01 10:59:35 -07:00
check-case.h [flang] Semantics for SELECT CASE 2020-03-27 12:02:11 -07:00
check-coarray.cpp [flang] Support for image selectors 2020-07-08 07:31:54 -07:00
check-coarray.h [flang] Support for image selectors 2020-07-08 07:31:54 -07:00
check-data.cpp [flang] Handle DATA initialization of EQUIVALENCE'd objects 2020-08-07 16:39:23 -07:00
check-data.h [flang] Handle DATA initialization of EQUIVALENCE'd objects 2020-08-07 16:39:23 -07:00
check-deallocate.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-deallocate.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-declarations.cpp [flang] Fix bogus error message with binding 2021-01-21 16:59:51 -08:00
check-declarations.h [flang] Improve initializer semantics, esp. for component default values 2020-12-07 14:40:41 -08:00
check-directive-structure.h [Flang][OpenMP] Add semantic checks for OpenMP clauses. 2021-03-01 19:54:41 +05:30
check-do-forall.cpp [flang] Fix classification of shape inquiries in specification exprs 2021-01-13 10:05:14 -08:00
check-do-forall.h [flang] Fix crash on erroneous expressions 2020-06-05 08:46:43 -07:00
check-if-stmt.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-if-stmt.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-io.cpp [flang] Refine WhyNotModifiable() 2021-01-19 11:44:51 -08:00
check-io.h [flang] Check that various variables referenced in I/O statements may be defined 2020-08-25 12:06:18 -07:00
check-namelist.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-namelist.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-nullify.cpp [flang] Fix bad dereference of NULLIFY pointer object 2021-03-08 15:01:36 -08:00
check-nullify.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-omp-structure.cpp [Flang][OpenMP] Add semantic checks for OpenMP clauses. 2021-03-01 19:54:41 +05:30
check-omp-structure.h [Flang][OpenMP] Add semantic checks for OpenMP clauses. 2021-03-01 19:54:41 +05:30
check-purity.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-purity.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-return.cpp [flang][NFC] Add GetTopLevelUnitContaining functions 2020-12-02 10:28:49 -08:00
check-return.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-select-rank.cpp [flang]Semantics for SELECT RANK. 2020-05-08 08:52:31 +05:30
check-select-rank.h [flang]Semantics for SELECT RANK. 2020-05-08 08:52:31 +05:30
check-select-type.cpp [FLANG] Fix issues in SELECT TYPE construct when intrinsic type specification is specified in TYPE GUARD statement. 2020-08-03 09:24:42 +05:30
check-select-type.h [flang] Semantics for SELECT TYPE 2020-06-12 00:12:24 +05:30
check-stop.cpp [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
check-stop.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
compute-offsets.cpp [flang] Add TypeAndShape::MeasureElementSizeInBytes() 2021-02-02 15:15:20 -08:00
compute-offsets.h [flang] Implement STORAGE_SIZE(), SIZEOF(), C_SIZEOF() 2020-12-15 17:26:20 -08:00
data-to-inits.cpp [flang] Implement STORAGE_SIZE(), SIZEOF(), C_SIZEOF() 2020-12-15 17:26:20 -08:00
data-to-inits.h [flang] Handle DATA initialization of EQUIVALENCE'd objects 2020-08-07 16:39:23 -07:00
expression.cpp [flang] Warn about useless explicit typing of intrinsics 2021-02-17 13:13:59 -08:00
mod-file.cpp [flang] Improve "Error reading module file" error message 2021-02-11 11:08:12 -08:00
mod-file.h [flang] Semantic analysis for FINAL subroutines 2020-09-30 15:46:15 -07:00
pointer-assignment.cpp [flang] Fix false error message for "ptr => func()" array conformance 2020-12-15 16:26:18 -08:00
pointer-assignment.h [flang] DATA stmt processing (part 3/4): Remaining prep work 2020-06-19 09:09:05 -07:00
program-tree.cpp [flang] Parse global compiler directives 2020-08-25 11:41:11 -07:00
program-tree.h [flang] Parse global compiler directives 2020-08-25 11:41:11 -07:00
resolve-directives.cpp Add Semantic check for Flang OpenMP 4.5 - 2.7.1 Do Loop restrictions for Threadprivate. 2021-03-08 20:32:26 +05:30
resolve-directives.h [flang][NFC] Extract name resolution for OpenACC & OpenMP into new file 2020-07-28 16:38:36 -07:00
resolve-labels.cpp [flang] Allow labels on END statements. 2020-11-11 13:06:19 -08:00
resolve-labels.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
resolve-names-utils.cpp [flang] Fix creation of deferred shape arrays by POINTER statement 2021-01-20 13:08:11 -08:00
resolve-names-utils.h [flang] Fix creation of deferred shape arrays by POINTER statement 2021-01-20 13:08:11 -08:00
resolve-names.cpp [flang] Prohibit MODULE procedures in the global scope 2021-03-03 11:50:50 -08:00
resolve-names.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
rewrite-parse-tree.cpp [flang] Clean up TODO comments and fix one (DATA constant ambiguity) 2020-12-15 13:36:07 -08:00
rewrite-parse-tree.h [flang] Reformat with latest clang-format and .clang-format 2020-03-28 21:00:16 -07:00
runtime-type-info.cpp [flang] Improve shape & length characterization 2021-01-30 16:14:27 -08:00
scope.cpp Making FindCommonBlock a const member 2021-02-22 10:10:11 -08:00
semantics.cpp [flang] Create names to allow access to inaccessible specifics 2021-01-15 16:56:38 -08:00
symbol.cpp [flang][msvc] Reapply "Explicitly reference "this" inside closure" 2021-02-04 16:33:51 -06:00
tools.cpp [flang] Support disabled alternative PARAMETER statement 2021-01-29 15:30:06 -08:00
type.cpp [flang] Support disabled alternative PARAMETER statement 2021-01-29 15:30:06 -08:00
unparse-with-symbols.cpp [flang][openacc] Basic name resolution infrastructure for OpenACC construct 2020-07-26 20:01:35 -04:00