op_pos is a dict from node to something. var isn't in it. node_pos was the cause of the crash. I removed it. What is important is the type of the var and its position in the input list. This is already there in ipos.