During SERVER-47191 let paramater expressions are agg expressions. They are evaluated during expression context construction and stored in the variables member of ExpressionContext, but you need an expression context to evaluate an agg expression. As a temporary hack we bump the ref count to this and use this to evaluate let params. We detach the temporary intrusive_ptr in an BLOCK_ON_EXIT scope. Undo this sorcery.