What kinds of structural remedies for this sort of problem exist in today's programming languages? That is, constructs (I assume as part of a type system) which make it impossible for this sort of thing to happen. (I realize in this case they were starting from assembly code -- I'm thinking about how to eliminate this kind of error in new, high level code.)