Files
swift-mirror/lib/AST/ConformanceLookupTable.cpp
Doug Gregor 47987cbcf9 [AST] Fix use-after-free due to a rogue getPointer().
ASan found this amusing stack-use-after-scope problem in the AST
that's been around for a long while. It was introduced when
`ModuleDecl::lookupConformance()` changed from returning an

    llvm::PointerIntPair<ProtocolConformance *, 2>

to an

    Optional<ProtocolConformanceRef>

In the former, `getPointer()` grabbed the `ProtocolConformance*`, which
was fine. In the latter, it produced a `ProtocolConformanceRef*`
pointing into a temporary value.

Fixes rdar://problem/31708629.
2017-04-24 08:35:52 -07:00

41 KiB