Small, hardy planets packed with dense elements have the best chance of avoiding being crushed and swallowed up when their host star dies, new research has found.