[all-commits] [llvm/llvm-project] 6a91ac: [flang][OpenMP] Keep hermetic embedded module pars...
Matt via All-commits
all-commits at lists.llvm.org
Mon Jul 13 11:14:36 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6a91acc642db38a6e214f1b917882c75d6fb728b
https://github.com/llvm/llvm-project/commit/6a91acc642db38a6e214f1b917882c75d6fb728b
Author: Matt <MattPD at users.noreply.github.com>
Date: 2026-07-13 (Mon, 13 Jul 2026)
Changed paths:
M flang/lib/Semantics/mod-file.cpp
A flang/test/Lower/OpenMP/declare-mapper-hermetic.f90
Log Message:
-----------
[flang][OpenMP] Keep hermetic embedded module parse tree alive (#207491)
Fix a use-after-free when lowering materializes an imported declare mapper or
declare reduction owned by a module embedded in a hermetic module file
(-fhermetic-module-files).
ModFileReader::Read resolved the embedded modules from a local parser::Program
that was destroyed when Read returned, leaving the symbols resolved from it
dangling. MapperDetails and UserReductionDetails hold raw parse-tree pointers, so
a consumer that later materializes such an imported declaration dereferenced
freed memory.
Retain the embedded parse tree in the SemanticsContext with SaveParseTree, as the
primary module's tree already is, so those pointers stay valid through lowering.
The new test covers materializing an imported declare mapper from an embedded
module.
Assisted-by: Claude Opus 4.8, GPT-5.5.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list