arybase.xs be more defensive
authorReini Urban <rurban@x-ray.at>
Tue, 22 Nov 2011 19:30:08 +0000 (13:30 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 23 Nov 2011 05:29:35 +0000 (21:29 -0800)
There can be no other keys used with ab_ck_base but clang's static
analyzer has a point in complaining about the missing default case.
This is too fragile if any CHECK is added in BOOT.

ext/arybase/arybase.xs

index d654b54..861b322 100644 (file)
@@ -343,6 +343,10 @@ static OP *ab_ck_base(pTHX_ OP *o)
  case OP_RINDEX   : old_ck = ab_old_ck_rindex   ; break;
  case OP_INDEX    : old_ck = ab_old_ck_index    ; break;
  case OP_POS      : old_ck = ab_old_ck_pos      ; break;
+ default:
+  DIE(aTHX_
+     "panic: invalid op type for arybase.xs:ab_ck_base: %d",
+      PL_op->op_type);
  }
  o = (*old_ck)(aTHX_ o);
  /* We need two switch blocks, as the type may have changed. */