Skip to content

Commit 35058cd

Browse files
authored
Fix incorrect line info computation (#4775)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent ca185ac commit 35058cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jerry-core/ecma/base/ecma-line-info.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ ecma_line_info_get (uint8_t *line_info_p, /**< line info buffer */
139139

140140
uint8_t *size_p = line_info_p + *line_info_p + (ECMA_LINE_INFO_STREAM_SIZE_MIN + 1);
141141

142-
end_offset += ecma_line_info_decode_vlq (&size_p);
142+
uint32_t next_end_offset = end_offset + ecma_line_info_decode_vlq (&size_p);
143143

144-
if (offset < end_offset)
144+
if (offset < next_end_offset)
145145
{
146146
break;
147147
}
148148

149+
end_offset = next_end_offset;
149150
line_info_p = size_p;
150151
}
151152

0 commit comments

Comments
 (0)