Pick up changes from master to 2.065 branch

Three regression fixes:
[REG2.056] Issue 12158 - ICE with .init of nonexisting selective import
[REG2.064] Issue 12044 - Invalid code gen causes segfault
[REG2.065a] Issue 12160 - UDA related regressions