8268360: Missing check for infinite loop during node placement
8268417: Add test from JDK-8268360

Reviewed-by: roland
2 files changed