From 967ce7f5e1239be52386afa0439d2c433809aeeb Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 2 Aug 2009 01:25:15 +0000 Subject: [PATCH] Fix a possible crash on delete of an uninitialized variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77846 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PIC16/PIC16TargetObjectFile.cpp | 5 +++++ lib/Target/PIC16/PIC16TargetObjectFile.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Target/PIC16/PIC16TargetObjectFile.cpp b/lib/Target/PIC16/PIC16TargetObjectFile.cpp index f287456743a..7b5d5574e5c 100644 --- a/lib/Target/PIC16/PIC16TargetObjectFile.cpp +++ b/lib/Target/PIC16/PIC16TargetObjectFile.cpp @@ -15,6 +15,11 @@ #include "llvm/MC/MCSection.h" using namespace llvm; +PIC16TargetObjectFile::PIC16TargetObjectFile() + : ExternalVarDecls(0), ExternalVarDefs(0) +{ +} + void PIC16TargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &tm){ TargetLoweringObjectFile::Initialize(Ctx, tm); TM = &tm; diff --git a/lib/Target/PIC16/PIC16TargetObjectFile.h b/lib/Target/PIC16/PIC16TargetObjectFile.h index c296954dce3..708c311e28e 100644 --- a/lib/Target/PIC16/PIC16TargetObjectFile.h +++ b/lib/Target/PIC16/PIC16TargetObjectFile.h @@ -52,7 +52,8 @@ namespace llvm { mutable std::vector ROSections; mutable PIC16Section *ExternalVarDecls; mutable PIC16Section *ExternalVarDefs; - + + PIC16TargetObjectFile(); ~PIC16TargetObjectFile(); void Initialize(MCContext &Ctx, const TargetMachine &TM);