Don't try to offset the location of the inserted velog. It crashes when the end of the tag is at the start of a line. Instead just use the end of the open tag, which also seems reasonable.
@@ -192,7 +192,6 @@ final class VeLogInstrumentationVisitor extends AbstractSoyNodeVisitor<Void> {
SourceLocation insertionLocation =
tag.getSourceLocation()
.getEndPoint()
- .offset(0, tag.isSelfClosing() ? -2 : -1)
.asLocation(tag.getSourceLocation().getFilePath());
FunctionNode funcNode =
FunctionNode.newPositional(
