Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d3713716b6b0
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1762b9616cf8
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 9, 2017

  1. Copy the full SHA
    17bb00d View commit details

Commits on Jul 10, 2017

  1. Merge pull request #1428 from rimmington/clearer-regex-space-error

    Clearer error message when regex exceeds space limit
    edolstra authored Jul 10, 2017
    Copy the full SHA
    1762b96 View commit details
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/libexpr/primops.cc
9 changes: 7 additions & 2 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
@@ -1734,8 +1734,13 @@ static void prim_match(EvalState & state, const Pos & pos, Value * * args, Value
mkString(*(v.listElems()[i] = state.allocValue()), match[i + 1].str().c_str());
}

} catch (std::regex_error &) {
throw EvalError("invalid regular expression ‘%s’, at %s", re, pos);
} catch (std::regex_error &e) {
if (e.code() == std::regex_constants::error_space) {
// limit is _GLIBCXX_REGEX_STATE_LIMIT for libstdc++
throw EvalError("memory limit exceeded by regular expression ‘%s’, at %s", re, pos);
} else {
throw EvalError("invalid regular expression ‘%s’, at %s", re, pos);
}
}
}