Thanks. I presume this comment ...
+ /*
+ * Relying on pname is fundamentally wrong. If the original pm was
+ * a reference, the resolved pname may refer to a hidden parameter.
+ * In that case, getsparam wrongly returns the value of the hiding
+ * parameter.
+ */
... refers to an un-resolved potential bug?