Go to file
Ilia K 686b1fe65a Fix FileSpec::GetPath to return null-terminated strings
Summary:
Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end.
It could have happened if the size of buffer for path was less than actual path.

Test case:
```
FileSpec test("/path/to/file", false);
char buf[]="!!!!!!";
test.GetPath(buf, 3);
```

Before fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/pa!!!"
```

After fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/p"
```

Reviewers: zturner, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh

Differential Revision: http://reviews.llvm.org/D7553

llvm-svn: 230787
2015-02-27 19:43:08 +00:00
clang Update Clang tests to handle explicitly typed gep changes in LLVM. 2015-02-27 19:18:17 +00:00
clang-tools-extra Add 'let' to the help message. 2015-02-27 17:53:23 +00:00
compiler-rt [ASan/Win] Update test expectations after r230724 2015-02-27 14:29:53 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc libclc/math: Add cospi 2015-02-26 15:42:00 +00:00
libcxx Add self to CREDITS.txt 2015-02-26 00:48:22 +00:00
libcxxabi Add remote testing support to the lit config 2015-02-26 15:55:01 +00:00
lld PECOFF: Use StringRef::find_first_of instead of a hand-written loop. 2015-02-27 18:06:41 +00:00
lldb Fix FileSpec::GetPath to return null-terminated strings 2015-02-27 19:43:08 +00:00
llgo Build cgo and llgo-go 2015-02-14 01:46:01 +00:00
llvm [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
openmp Removed all header files for OpenMP 2.5 2015-02-25 18:38:08 +00:00
polly Update Polly tests to handle explicitly typed gep changes in LLVM 2015-02-27 19:20:19 +00:00