From: Jakob Stoklund Olesen Date: Sun, 21 Oct 2012 19:05:03 +0000 (+0000) Subject: Don't crash when the Assignments vector is empty. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=56acf63e35440068935bca999d19a81f76e876d6;p=oota-llvm.git Don't crash when the Assignments vector is empty. Reported by Vincent Lejeune using an out-of-tree target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166398 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp index ba6b4569a8f..2ca67d63257 100644 --- a/lib/CodeGen/RegisterCoalescer.cpp +++ b/lib/CodeGen/RegisterCoalescer.cpp @@ -1302,7 +1302,7 @@ public: SmallVectorImpl &ShrinkRegs); /// Get the value assignments suitable for passing to LiveInterval::join. - const int *getAssignments() const { return &Assignments[0]; } + const int *getAssignments() const { return Assignments.data(); } }; } // end anonymous namespace