~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/VMCore/SymbolTableListTraitsImpl.h

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===-- llvm/SymbolTableListTraitsImpl.h - Implementation ------*- 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 the stickier parts of the SymbolTableListTraits class,
 
11
// and is explicitly instantiated where needed to avoid defining all this code
 
12
// in a widely used header.
 
13
//
 
14
//===----------------------------------------------------------------------===//
 
15
 
 
16
#ifndef LLVM_SYMBOLTABLELISTTRAITS_IMPL_H
 
17
#define LLVM_SYMBOLTABLELISTTRAITS_IMPL_H
 
18
 
 
19
#include "llvm/SymbolTableListTraits.h"
 
20
#include "llvm/ValueSymbolTable.h"
 
21
 
 
22
namespace llvm {
 
23
 
 
24
/// setSymTabObject - This is called when (f.e.) the parent of a basic block
 
25
/// changes.  This requires us to remove all the instruction symtab entries from
 
26
/// the current function and reinsert them into the new function.
 
27
template<typename ValueSubClass, typename ItemParentClass>
 
28
template<typename TPtr>
 
29
void SymbolTableListTraits<ValueSubClass,ItemParentClass>
 
30
::setSymTabObject(TPtr *Dest, TPtr Src) {
 
31
  // Get the old symtab and value list before doing the assignment.
 
32
  ValueSymbolTable *OldST = TraitsClass::getSymTab(getListOwner());
 
33
 
 
34
  // Do it.
 
35
  *Dest = Src;
 
36
  
 
37
  // Get the new SymTab object.
 
38
  ValueSymbolTable *NewST = TraitsClass::getSymTab(getListOwner());
 
39
  
 
40
  // If there is nothing to do, quick exit.
 
41
  if (OldST == NewST) return;
 
42
  
 
43
  // Move all the elements from the old symtab to the new one.
 
44
  iplist<ValueSubClass> &ItemList = TraitsClass::getList(getListOwner());
 
45
  if (ItemList.empty()) return;
 
46
  
 
47
  if (OldST) {
 
48
    // Remove all entries from the previous symtab.
 
49
    for (typename iplist<ValueSubClass>::iterator I = ItemList.begin();
 
50
         I != ItemList.end(); ++I)
 
51
      if (I->hasName())
 
52
        OldST->removeValueName(I->getValueName());
 
53
  }
 
54
 
 
55
  if (NewST) {
 
56
    // Add all of the items to the new symtab.
 
57
    for (typename iplist<ValueSubClass>::iterator I = ItemList.begin();
 
58
         I != ItemList.end(); ++I)
 
59
      if (I->hasName())
 
60
        NewST->reinsertValue(I);
 
61
  }
 
62
  
 
63
}
 
64
 
 
65
template<typename ValueSubClass, typename ItemParentClass>
 
66
void SymbolTableListTraits<ValueSubClass,ItemParentClass>
 
67
::addNodeToList(ValueSubClass *V) {
 
68
  assert(V->getParent() == 0 && "Value already in a container!!");
 
69
  ItemParentClass *Owner = getListOwner();
 
70
  V->setParent(Owner);
 
71
  if (V->hasName())
 
72
    if (ValueSymbolTable *ST = TraitsClass::getSymTab(Owner))
 
73
      ST->reinsertValue(V);
 
74
}
 
75
 
 
76
template<typename ValueSubClass, typename ItemParentClass>
 
77
void SymbolTableListTraits<ValueSubClass,ItemParentClass>
 
78
::removeNodeFromList(ValueSubClass *V) {
 
79
  V->setParent(0);
 
80
  if (V->hasName())
 
81
    if (ValueSymbolTable *ST = TraitsClass::getSymTab(getListOwner()))
 
82
      ST->removeValueName(V->getValueName());
 
83
}
 
84
 
 
85
template<typename ValueSubClass, typename ItemParentClass>
 
86
void SymbolTableListTraits<ValueSubClass,ItemParentClass>
 
87
::transferNodesFromList(ilist_traits<ValueSubClass> &L2,
 
88
                        ilist_iterator<ValueSubClass> first,
 
89
                        ilist_iterator<ValueSubClass> last) {
 
90
  // We only have to do work here if transferring instructions between BBs
 
91
  ItemParentClass *NewIP = getListOwner(), *OldIP = L2.getListOwner();
 
92
  if (NewIP == OldIP) return;  // No work to do at all...
 
93
 
 
94
  // We only have to update symbol table entries if we are transferring the
 
95
  // instructions to a different symtab object...
 
96
  ValueSymbolTable *NewST = TraitsClass::getSymTab(NewIP);
 
97
  ValueSymbolTable *OldST = TraitsClass::getSymTab(OldIP);
 
98
  if (NewST != OldST) {
 
99
    for (; first != last; ++first) {
 
100
      ValueSubClass &V = *first;
 
101
      bool HasName = V.hasName();
 
102
      if (OldST && HasName)
 
103
        OldST->removeValueName(V.getValueName());
 
104
      V.setParent(NewIP);
 
105
      if (NewST && HasName)
 
106
        NewST->reinsertValue(&V);
 
107
    }
 
108
  } else {
 
109
    // Just transferring between blocks in the same function, simply update the
 
110
    // parent fields in the instructions...
 
111
    for (; first != last; ++first)
 
112
      first->setParent(NewIP);
 
113
  }
 
114
}
 
115
 
 
116
} // End llvm namespace
 
117
 
 
118
#endif