Branch: refs/heads/master
Revision: d54a88a
Author: mppf
Log Message:
Merge pull request #17561 from mppf/fix-atomic-obj-memcpy-error
Fix a case where AtomicObject would call memcpy with overflowing size
AtomicObject has a 'decompress' routine that unpacks a packed pointer and
returns it. It uses memcpy to copy an untyped wide pointer into a typed
one. This memcpy is only actually run if the locale field differs, which
should not happen in single locale compilation
At the same time, a C compiler doing static analysis of this memcpy would
notice that, in a single locale compilation, it overflows the destination
(since in that event the destination is only 8 bytes but it's copying
16).
This commit just includes _local
in the earlier condition to make the
memcpy not be emitted for single-locale builds.
- test/library/packages/{LockFreeStack,LockFreeQueue,EpochManager} passes with
- [x] quickstart + system LLVM
- [x] quickstart + gasnet + system LLVM
- [x] default config + system LLVM
- [x] default config + gasnet + system LLVM
Reviewed by @daviditen - thanks!
Modified Files:
M modules/packages/AtomicObjects.chpl
Compare: https://github.com/chapel-lang/chapel/compare/439316123860...d54a88a62f45