projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
645d755
)
Fixed an bug found by running LLDB with the address sanitizer! We were accessing...
author
Greg Clayton
<gclayton@apple.com>
Thu, 7 Feb 2013 03:38:34 +0000
(
03:38
+0000)
committer
Greg Clayton
<gclayton@apple.com>
Thu, 7 Feb 2013 03:38:34 +0000
(
03:38
+0000)
llvm-svn: 174578
lldb/source/Core/SourceManager.cpp
patch
|
blob
|
history
diff --git
a/lldb/source/Core/SourceManager.cpp
b/lldb/source/Core/SourceManager.cpp
index
65b8165
..
8d3400d
100644
(file)
--- a/
lldb/source/Core/SourceManager.cpp
+++ b/
lldb/source/Core/SourceManager.cpp
@@
-569,11
+569,14
@@
SourceManager::File::CalculateLineOffsets (uint32_t line)
register char curr_ch = *s;
if (is_newline_char (curr_ch))
{
- register char next_ch = s[1];
- if (is_newline_char (next_ch))
+ if (s + 1 < end)
{
- if (curr_ch != next_ch)
- ++s;
+ register char next_ch = s[1];
+ if (is_newline_char (next_ch))
+ {
+ if (curr_ch != next_ch)
+ ++s;
+ }
}
m_offsets.push_back(s + 1 - start);
}