This might happen on newer perls where SVt_RV has been merged into SVt_IV.
Fixes RT#39149.
case SVt_RV:
/* BAH! constants are horrible */
+ if (!SvROK (gv)) {
+ continue;
+ }
+
/* we don't really care about the length,
but that's the API */
key = HePV(he, keylen);