Browse Source

[2593] Workaround the aliasing problem in boost::optional

This uses the workaround suggested by Jinmei in:
https://lists.isc.org/pipermail/bind10-dev/2013-January/004192.html

It is less optimal than the normal code, but we have no choice if we
have to support Debian 6 stable which currently ships with a broken
Boost.
Mukund Sivaraman 12 years ago
parent
commit
d86e308e8d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/lib/dns/master_loader.cc

+ 6 - 1
src/lib/dns/master_loader.cc

@@ -222,7 +222,12 @@ private:
         const MaybeRRClass rrclass =
             RRClass::createFromText(rrparam_token.getString());
         if (rrclass) {
-            if (*rrclass != zone_class_) {
+            // FIXME: The following code re-parses the rrparam_token to
+            // make an RRClass instead of using the MaybeRRClass above,
+            // because some old versions of boost::optional (that we
+            // still want to support) have a bug (see trac #2593). This
+            // workaround should be removed at some point in the future.
+            if (RRClass(rrparam_token.getString()) != zone_class_) {
                 isc_throw(InternalException, "Class mismatch: " << *rrclass <<
                           " vs. " << zone_class_);
             }