diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 968a565197c..c980a7189a3 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -215,9 +215,9 @@ void LandingPadInst::growOperands() { } void LandingPadInst::reserveClauses(unsigned Size) { - unsigned e = getNumOperands() + Size; - if (ReservedSpace >= e) return; - ReservedSpace = e; + unsigned e = getNumOperands(); + if (ReservedSpace >= e + Size) return; + ReservedSpace = e + Size; Use *NewOps = allocHungoffUses(ReservedSpace); Use *OldOps = OperandList;