unsound recursion via references