File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
csharp/ql/lib/semmle/code/csharp Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 88import Element
99import Location
1010
11+ private Location unmapLoc ( Location l ) {
12+ result .( SourceLocation ) .getMappedLocation ( ) = l
13+ or
14+ not exists ( result .( SourceLocation ) .getMappedLocation ( ) ) and
15+ result = l
16+ }
17+
1118/**
1219 * A single line of comment.
1320 *
@@ -19,7 +26,7 @@ class CommentLine extends @commentline {
1926 string toString ( ) { none ( ) }
2027
2128 /** Gets the location of this comment line. */
22- Location getLocation ( ) { commentline_location ( this , result ) }
29+ Location getLocation ( ) { commentline_location ( this , unmapLoc ( result ) ) }
2330
2431 /** Gets the containing comment block. */
2532 CommentBlock getParent ( ) { result .getAChild ( ) = this }
@@ -159,7 +166,7 @@ class CommentBlock extends @commentblock {
159166 string toString ( ) { result = this .getChild ( 0 ) .toString ( ) }
160167
161168 /** Gets the location of this comment block */
162- Location getLocation ( ) { commentblock_location ( this , result ) }
169+ Location getLocation ( ) { commentblock_location ( this , unmapLoc ( result ) ) }
163170
164171 /** Gets the number of lines in this comment block. */
165172 int getNumLines ( ) { result = count ( this .getAChild ( ) ) }
You can’t perform that action at this time.
0 commit comments