Under XQuery Update, when the optimizer tries to inline an updating function, the compiler may crash with the message
"*** Internal Saxon error: local variable encountered whose binding has been deleted"
This only happens if there is more than one call on the updating function.
Functions are inlined if they contain no calls on other user-defined functions and if the body of the function is sufficiently simple/small.
A patch has been produced and is committed to the Saxon-SA subversion repository; it will be present in the next Saxon-SA 9.1.x maintenance release.