Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 15da7353b87cc478130e93bf9b4642cb33dc393a..2e16e0d932c82c92f1dd28717ec0ea70ce312acd 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -12725,7 +12725,8 @@ bool Script::GetPositionInfo(int position, PositionInfo* info, |
if (info->line_end > 0) { |
DCHECK(script->source()->IsString()); |
Handle<String> src(String::cast(script->source())); |
- if (src->Get(info->line_end - 1) == '\r') { |
+ if (src->length() >= info->line_end && |
+ src->Get(info->line_end - 1) == '\r') { |
info->line_end--; |
} |
} |