From 909450ec1351b910c46baddbf4bfedde527dde87 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Thu, 6 Sep 2012 11:58:02 -0700 Subject: [PATCH] Adding a few run-time asserts --- cpp/ycm/ClangCompleter/ClangUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/ycm/ClangCompleter/ClangUtils.cpp b/cpp/ycm/ClangCompleter/ClangUtils.cpp index 14fcf48a..70f571d9 100644 --- a/cpp/ycm/ClangCompleter/ClangUtils.cpp +++ b/cpp/ycm/ClangCompleter/ClangUtils.cpp @@ -35,7 +35,9 @@ std::vector< CXUnsavedFile > ToCXUnsavedFiles( std::vector< CXUnsavedFile > clang_unsaved_files( unsaved_files.size() ); for ( uint i = 0; i < unsaved_files.size(); ++i ) { - // TODO: assert non-null + X_VERIFY( unsaved_files[ i ].filename_ ); + X_VERIFY( unsaved_files[ i ].contents_ ); + X_VERIFY( unsaved_files[ i ].length_ ); clang_unsaved_files[ i ].Filename = unsaved_files[ i ].filename_; clang_unsaved_files[ i ].Contents = unsaved_files[ i ].contents_; clang_unsaved_files[ i ].Length = unsaved_files[ i ].length_;