Frank Mittelbach <[log in to unmask]> writes:

> well, you seem to be the first person getting into trouble with this,
> but that doesn't mean one shouldn't fix it.

5000 labels is easy to reach if you are using the label mechanism
extensively.

> I don't really mind either of the three solutions (provided none of
> the kills the regression tests for 2e) but personally I would simply
> drop the group unless somebody can give me a good reason why it could
> be needed in a certain situation.

Other code checking the definition of the current label?  Or something?
No idea.  Maybe to keep the effect of \tmpswawhatever local?

Otherwise, here is what I would propose (since it mimics a definition
elsewhere with regard to label save stack buildup in ltxref.dtx).