summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/TableGen/Record.h6
-rw-r--r--llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp4
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index 2069b2704a0..9140b3a9c5e 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -468,6 +468,9 @@ class BitsInit final : public TypedInit, public FoldingSetNode,
BitsInit &operator=(const BitsInit &Other) = delete;
public:
+ // Do not use sized deallocation due to trailing objects.
+ void operator delete(void *p) { ::operator delete(p); }
+
static bool classof(const Init *I) {
return I->getKind() == IK_BitsInit;
}
@@ -601,6 +604,9 @@ private:
ListInit &operator=(const ListInit &Other) = delete;
public:
+ // Do not use sized deallocation due to trailing objects.
+ void operator delete(void *p) { ::operator delete(p); }
+
static bool classof(const Init *I) {
return I->getKind() == IK_ListInit;
}
diff --git a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
index 5c64d7818ac..a0b15d52797 100644
--- a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
+++ b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
@@ -378,6 +378,10 @@ public:
}
}
+ // Disable use of sized deallocation due to overallocation of PPCOperand
+ // objects in CreateTokenWithStringCopy.
+ void operator delete(void *p) { ::operator delete(p); }
+
/// getStartLoc - Get the location of the first token of this operand.
SMLoc getStartLoc() const override { return StartLoc; }
OpenPOWER on IntegriCloud