diff options
author | Alexandre Oliva <oliva@adacore.com> | 2021-07-13 22:25:56 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2021-07-13 22:28:25 -0300 |
commit | a7098d6ef4e4e799dab8ef925c62b199d707694b (patch) | |
tree | 8b95b2de5afa25aea65e0029bd250357a8d12fca /gcc/tree-ssa-alias.c | |
parent | 66907e739959ff85490f1711cfd06fdf1e946945 (diff) | |
download | gcc-a7098d6ef4e4e799dab8ef925c62b199d707694b.zip gcc-a7098d6ef4e4e799dab8ef925c62b199d707694b.tar.gz gcc-a7098d6ef4e4e799dab8ef925c62b199d707694b.tar.bz2 |
fix typo in attr_fnspec::verify
Odd-numbered indices describing argument access sizes in the fnspec
string can only hold 't' or a digit, as tested in the beginning of the
case. When checking that the size-supplying argument does not have
additional information associated with it, the test that excludes the
't' possibility looks for it at the even position in the fnspec
string. Oops.
This might yield false positives and negatives if a function has a
fnspec in which an argument uses a 't' access-size, and ('t' - '1')
happens to be the index of an argument described in an fnspec string.
Assuming ASCII encoding, it would take a function with at least 68
arguments described in fnspec. Still, probably worth fixing.
for gcc/ChangeLog
* tree-ssa-alias.c (attr_fnspec::verify): Fix index in
non-'t'-sized arg check.
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 0421bfa..742a95a 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -3895,7 +3895,7 @@ attr_fnspec::verify () && str[idx] != 'w' && str[idx] != 'W' && str[idx] != 'o' && str[idx] != 'O') err = true; - if (str[idx] != 't' + if (str[idx + 1] != 't' /* Size specified is scalar, so it should be described by ". " if specified at all. */ && (arg_specified_p (str[idx + 1] - '1') |