backport assignment hazards fix from lj-lang-toolkit