Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 3b1c24f0dd3283102e837c9692edb3e8f6858c62..47be93aeeb3ac49e81fa87e105dc4a392daff286 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -12747,7 +12747,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--; |
} |
} |