Skip to content

Commit

Permalink
DebugInfo fix file association for corner case
Browse files Browse the repository at this point in the history
If line gets successfully retrieved from subrange instead of
primaryrange get file index from the subrange since the line might be
from a different file for inlined methods.
  • Loading branch information
zakkak committed Oct 7, 2020
1 parent 93bfa4e commit 0373461
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,18 @@ private int writeLineNumberTable(DebugContext context, ClassEntry classEntry, by
*/
long line = primaryRange.getLine();
if (line < 0 && primaryEntry.getSubranges().size() > 0) {
line = primaryEntry.getSubranges().get(0).getLine();
final Range subRange = primaryEntry.getSubranges().get(0);
line = subRange.getLine();
/*
* If line gets successfully retrieved from subrange get file index from there since
* the line might be from a different file for inlined methods
*/
if (line > 0) {
FileEntry subFileEntry = primaryEntry.getSubrangeFileEntry(subRange);
if (subFileEntry != null) {
fileIdx = classEntry.localFilesIdx(subFileEntry);
}
}
}
if (line < 0) {
line = 0;
Expand Down

0 comments on commit 0373461

Please sign in to comment.