aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-resolve-path.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-03-01 15:15:07 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-03-03 15:11:23 +0100
commita498b2c5d6d64c40955b3c13fd6ca8dc72a7bd67 (patch)
treedf00837f0ae677da367d063b672e9e01a4ec6c7a /gcc/rust/backend/rust-compile-resolve-path.cc
parent6cf9f8c99c5813a23d7cec473fedf00683f409e4 (diff)
downloadgcc-a498b2c5d6d64c40955b3c13fd6ca8dc72a7bd67.zip
gcc-a498b2c5d6d64c40955b3c13fd6ca8dc72a7bd67.tar.gz
gcc-a498b2c5d6d64c40955b3c13fd6ca8dc72a7bd67.tar.bz2
macro-substitute: Do not substitute non-repetition fragments in sub-maps
When creating a sub-map for repetitions, we need to be weary of not accessing matched-fragments beyond the vector's size. For example, with the following *fragments* { "e": [1], "es": [2, 3, 10]}, the sub-maps we want to create are the following: { "e": [1], "es": [2]}, { "e": [1], "es": [3]}, { "e": [1], "es": [10]}, Up until this point however, we were trying to access the second index for the "e" metavar when creating the second submap, then the third, and so on... which is obviously outside of the vector's bounds. We can simply check if the metavar only has one match and expand that one in that case. We still need to work on checking that multiple metavars in the same transcriber repetition pattern have the same amount of matched fragments (ie the original vectors of matches in the original map have the same size)
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
0 files changed, 0 insertions, 0 deletions