Fix PR4948 (and a leak): by not destroying the DwarfException
[llvm/avr.git] / lib / Bitcode / Reader / DeserializeAPInt.cpp
blob1b5b2bf1ff14e8aa0d45eaa0acddcaa3ceef9dda
1 //===-- DeserializeAPInt.cpp - Deserialization for APInts ------*- C++ -*--===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements deserialization of APInts.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/ADT/APInt.h"
15 #include "llvm/Bitcode/Deserialize.h"
16 #include <cassert>
18 using namespace llvm;
20 void APInt::Read(Deserializer& D) {
21 BitWidth = D.ReadInt();
23 if (isSingleWord())
24 VAL = D.ReadInt();
25 else {
26 uint32_t NumWords = D.ReadInt();
27 assert (NumWords > 1);
28 pVal = new uint64_t[NumWords];
29 assert (pVal && "Allocation in deserialization of APInt failed.");
30 for (unsigned i = 0; i < NumWords; ++i)
31 pVal[i] = D.ReadInt();