If routine runtime errors occur during execution, the c->last_stmt
variable is printed to the user as to best suspected script location
of the failure. As an optimization, this variable is not set at every
little point during statement/expression evaluation that are not
likely to cause errors. But we overlooked one spot where it's
absolutely needed: around function calls, especially into synthetic
embedded-c functions that process $context variables. That meant that
error messages could misidentify some other recent but nonspecific
point for an error.
Now we add a c->last_stmt set immediately before each function call,
after its actual arguments are executed. This placement also covers
the case where the arguments themselves might fail during evaluation.