Commit 71292379 authored by Richard Smith's avatar Richard Smith
Browse files

Make LazyCallThroughManager destructor virtual rather than arranging for

all clients to delete it via the correct dynamic type.
parent 74c8d01a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ private:
  // Create a single-threaded LLLazyJIT instance.
  LLLazyJIT(LLLazyJITBuilderState &S, Error &Err);

  std::unique_ptr<LocalLazyCallThroughManager> LCTMgr;
  std::unique_ptr<LazyCallThroughManager> LCTMgr;
  std::unique_ptr<CompileOnDemandLayer> CODLayer;
};

@@ -384,7 +384,7 @@ public:

  Triple TT;
  JITTargetAddress LazyCompileFailureAddr = 0;
  std::unique_ptr<LocalLazyCallThroughManager> LCTMgr;
  std::unique_ptr<LazyCallThroughManager> LCTMgr;
  IndirectStubsManagerBuilderFunction ISMBuilder;

  Error prepareForConstruction();
+3 −2
Original line number Diff line number Diff line
@@ -50,13 +50,14 @@ public:
      JITTargetAddress TrampolineAddr,
      TrampolinePool::NotifyLandingResolvedFunction NotifyLandingResolved);

  virtual ~LazyCallThroughManager() = default;

protected:
  using NotifyLandingResolvedFunction =
      TrampolinePool::NotifyLandingResolvedFunction;

  LazyCallThroughManager(ExecutionSession &ES,
                         JITTargetAddress ErrorHandlerAddr, TrampolinePool *TP);
  ~LazyCallThroughManager() = default;

  struct ReexportsEntry {
    JITDylib *SourceJD;
@@ -128,7 +129,7 @@ public:

/// Create a LocalLazyCallThroughManager from the given triple and execution
/// session.
Expected<std::unique_ptr<LocalLazyCallThroughManager>>
Expected<std::unique_ptr<LazyCallThroughManager>>
createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES,
                                  JITTargetAddress ErrorHandlerAddr);

+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ void LazyCallThroughManager::resolveTrampolineLandingAddress(
      NoDependenciesToRegister);
}

Expected<std::unique_ptr<LocalLazyCallThroughManager>>
Expected<std::unique_ptr<LazyCallThroughManager>>
createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES,
                                  JITTargetAddress ErrorHandlerAddr) {
  switch (T.getArch()) {