promql/parser/ast.go:499
Nil pointer dereference: e.RHS.PositionRange() inside if e.RHS == nil
The branch at lines 496-501 is entered only when e.RHS == nil. The PR changed e.LHS.PositionRange().End to e.RHS.PositionRange().End, so this now calls a method on a nil interface and panics. The branch is for a duration expression with only an LHS, where the end position must come from LHS. The next branch (e.LHS == nil) correctly uses RHS, so this change looks like a copy-paste error.
DurationExpr.PositionRange is reached through mergeRanges, MatrixSelector, SubqueryExpr and similar callers. Any…