diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-01 17:26:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 17:26:07 +0000 |
commit | 6cf9f8c99c5813a23d7cec473fedf00683f409e4 (patch) | |
tree | cd590bc5f7b266c043499899e0529ff4c16cc5ec /gcc/rust/util/rust-hir-map.cc | |
parent | e82b59dfc9319d72f891bac099bfa0f46d8b8c99 (diff) | |
parent | f7ff6020f8c68e4fb54c17c4460aa7f8a31f85bd (diff) | |
download | gcc-6cf9f8c99c5813a23d7cec473fedf00683f409e4.zip gcc-6cf9f8c99c5813a23d7cec473fedf00683f409e4.tar.gz gcc-6cf9f8c99c5813a23d7cec473fedf00683f409e4.tar.bz2 |
Merge #983
983: Parse proper cfg values r=CohenArthur a=CohenArthur
Closes #936
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/util/rust-hir-map.cc')
-rw-r--r-- | gcc/rust/util/rust-hir-map.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc index d154a8a..9190bd9 100644 --- a/gcc/rust/util/rust-hir-map.cc +++ b/gcc/rust/util/rust-hir-map.cc @@ -139,7 +139,10 @@ NodeId Mappings::get_next_node_id (CrateNum crateNum) { auto it = nodeIdIter.find (crateNum); - rust_assert (it != nodeIdIter.end ()); + // We're probably *not* parsing actual rust code... but mostly reusing + // the parser in another way. Return 0 + if (it == nodeIdIter.end ()) + return 0; auto id = it->second + 1; nodeIdIter[crateNum] = id; |