Do not resolve labels across function boundary

Fix #19331.