Permalink
Browse files

change a condition that can't be triggered to an assertion

  • Loading branch information...
1 parent 11dc7f6 commit 0b29d99d0020fa99a76e64978e8ba59c3ba6afa5 @NotFound NotFound committed Dec 24, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/pmc/exporter.pmc
View
9 src/pmc/exporter.pmc
@@ -327,9 +327,12 @@ Throws an exception upon error.
"source namespace not set");
GET_ATTR_ns_dest(INTERP, SELF, ns_dest);
- if (PMC_IS_NULL(ns_dest))
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "destination namespace not set");
+
+ /* This condition must never happen, destination is set during init and
+ * attempts to change it with wrong values are rejected.
+ * Even if it gets changed for unexpected reasons, "export_to" will
+ * catch the problem. */
+ PARROT_ASSERT(!PMC_IS_NULL(ns_dest));
GET_ATTR_globals(INTERP, SELF, ns_globals);

0 comments on commit 0b29d99

Please sign in to comment.