From fd4ced2c5200879d337a52799f076456817e5095 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sun, 21 Oct 2012 19:05:03 +0000 Subject: [PATCH] Don't crash when the Assignments vector is empty. Reported by Vincent Lejeune using an out-of-tree target. llvm-svn: 166398 --- llvm/lib/CodeGen/RegisterCoalescer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index ba6b456..2ca67d6 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/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 -- 2.7.4