Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index a5da88a0b3b2e0b5e44b17e0918d17655ea38e09..f26bb1e4100973808b534f48695cbcb092c3333c 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -12767,7 +12767,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--; |
} |
} |