Author: eelco Date: Thu Oct 27 19:06:23 2011 New Revision: 30070 URL: https://nixos.org/websvn/nix/?rev=30070&sc=1
Log: * In printValueAsXML, handle the case where a "type" attribute is not a string. This happens in the NixOS option system. * Remove a bogus comparison of a unsigned integer with -1. Modified: nix/trunk/src/libexpr/eval.cc Modified: nix/trunk/src/libexpr/eval.cc ============================================================================== --- nix/trunk/src/libexpr/eval.cc Thu Oct 27 18:42:32 2011 (r30069) +++ nix/trunk/src/libexpr/eval.cc Thu Oct 27 19:06:23 2011 (r30070) @@ -170,8 +170,8 @@ size_t size = 32 * 1024 * 1024; #if HAVE_SYSCONF && defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) long pageSize = sysconf(_SC_PAGESIZE); - long pages = sysconf (_SC_PHYS_PAGES); - if (pageSize != -1 && size != -1) + long pages = sysconf(_SC_PHYS_PAGES); + if (pageSize != -1) size = (pageSize * pages) / 4; // 25% of RAM if (size > maxSize) size = maxSize; #endif @@ -1108,7 +1108,10 @@ { if (v.type != tAttrs) return false; Bindings::iterator i = v.attrs->find(sType); - return i != v.attrs->end() && forceStringNoCtx(*i->value) == "derivation"; + if (i == v.attrs->end()) return false; + forceValue(*i->value); + if (i->value->type != tString) return false; + return forceStringNoCtx(*i->value) == "derivation"; } _______________________________________________ nix-commits mailing list nix-comm...@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-commits