aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov.c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2021-06-25 19:37:11 +0200
committerMark Wielaard <mark@klomp.org>2021-06-25 21:50:37 +0200
commit60cb8cc43b91ff8a00be45be1106f95f161e9c8d (patch)
treebd85ffbf6bf29ece4c4409e39d24fba3fb37748f /gcc/gcov.c
parent99bc27d278359be9aec5597504807a6456a88a6c (diff)
downloadgcc-60cb8cc43b91ff8a00be45be1106f95f161e9c8d.zip
gcc-60cb8cc43b91ff8a00be45be1106f95f161e9c8d.tar.gz
gcc-60cb8cc43b91ff8a00be45be1106f95f161e9c8d.tar.bz2
Reject non-pure decimal tuple indexes.
Tuple indexes should be pure decimal integer literals. But the parser just sees an integer literal. Fix this by introducing a new type hint CORETYPE_PURE_DECIMAL. This doesn't conflict with any existing type hints since a pure decimal doesn't have a type suffix. Introduce a new method is_pure_decimal that the parser can use in parse_tuple_index_expr. get_type_hint will return CORETYPE_UNKNOWN for pure decimals. parse_decimal_int_or_float will check whether there are no execissive leading zeros. parse_in_decimal checks the literal doesn't contain any underscores. Add two testcases. bad_tuple_index.rs with all variants of integer literals which aren't pure decimals. And tuple_index.rs with various correct tuple indexes. Resolves: https://github.com/Rust-GCC/gccrs/issues/511
Diffstat (limited to 'gcc/gcov.c')
0 files changed, 0 insertions, 0 deletions